WIP - trying to get select2 wired up for importer

This commit is contained in:
Brady Wetherington 2022-09-27 16:37:39 -07:00
parent 8009ee79db
commit 5c97e45d00
2 changed files with 16 additions and 23 deletions

View file

@ -10,7 +10,9 @@
</div>
<div class="col-md-7 col-xs-12">
{{ Form::select('importType', $importTypes, 0 /* FIXME whats' the old value? */, ['placeholder' => '', 'wire:model' => 'importType', 'wire:change' => 'changeTypes']) }}
<span wire:ignore>
{{ Form::select('importType', $importTypes, 0 /* FIXME whats' the old value? */, ['class' => 'livewire-select2', 'placeholder' => '', 'data-livewire-model' => 'importType']) }}
</span>
{{-- <select2 :options="options.importTypes" v-model="options.importType" required> --}}
{{-- <option disabled value="0"></option> --}}
{{-- </select2> --}}
@ -205,3 +207,15 @@
</tr>
{{-- </template> --}}
<script>
console.warn("Doodie doodie butt farts")
$('.livewire-select2').select2();
console.warn("Select2 has been activated within the livewire context (maybe?)")
$('.livewire-select2').on('select2:select', function (event) {
console.log("select2 selected!!!!!!!!!!!")
})
$('.livewire-select2').on('change',function (event) {
console.warn("Original target is: "+event.target)
// find the data-livewire-model thing?
})
</script>

View file

@ -2,7 +2,7 @@
{{-- <importer inline-template v-cloak> --}} {{-- like, this, here, that's a literal Vue directive --}}
<div class="row">
{{-- <alert v-show="alert.visible" :alert-type="alert.type" v-on:hide="alert.visible = false">@{{ alert.message }}</alert> --}}
<template>
<template> {{-- this is going to take some porting :/ --}}
<div class="box" v-if="errors">
<div class="box-body">
<div class="alert alert-warning">
@ -45,27 +45,6 @@
</div>
@endif
<script>
fixme = {
/*
* The component's data.
*/
props: ['alertType', 'title'],
computed: {
alertClassName() {
return 'alert-' + this.alertType;
}
},
methods: {
hideEvent() {
this.$emit('hide');
}
}
}
</script>
{{-- errors thing that's built-in maybe? --}}
{{-- <errors :errors="importErrors"></errors> --}}