add: completed register view

This commit is contained in:
Alexandro Uc Santos
2023-11-25 19:52:45 -06:00
parent ec02b98272
commit dd674b053b
13 changed files with 712 additions and 131 deletions

View File

@@ -0,0 +1,61 @@
<script setup>
import { ref } from 'vue';
import VueMultiselect from 'vue-multiselect'
import { searchcategories } from '../../services/public';
const options = ref([]);
const isLoading = ref(false);
// defineProps(['selectedCategory']);
defineProps({
selectedCategory: {
type: Array
},
multiple: {
type: Boolean,
default: false
}
});
defineEmits(['update:selectedCategory', 'clear-option'])
const searchCategory = async(query) => {
isLoading.value = true;
const resp = await searchcategories(query);
options.value = resp;
isLoading.value = false;
// truckTypes.value = resp;
}
</script>
<template>
<VueMultiselect
:value="selectedCategory"
@input="$event => $emit('update:selectedCategory', $event.target.value)"
:options="options"
:multiple="multiple"
:searchable="true"
:loading="isLoading"
:close-on-select="true"
@search-change="searchCategory"
@remove="$emit('clear-option')"
placeholder="Busca por segmento"
label="name"
track-by="name"
selectLabel="Presione para seleccionar"
selectedLabel="Selecionado"
deselectLabel="Presione para remover selecion"
>
<template #noResult>
Oops! No se encontro coincidencias.
</template>
<template #noOptions>
Lista vacia.
</template>
</VueMultiselect>
</template>
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
<style scoped>
</style>