- select specializz.

This commit is contained in:
paoloar77
2021-12-31 01:44:16 +01:00
parent 664b469d99
commit f31eb0ea99
18 changed files with 293 additions and 260 deletions

View File

@@ -1,4 +1,4 @@
import { computed, defineComponent, onMounted, ref } from 'vue'
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import { useI18n } from '@src/boot/i18n'
import { useUserStore } from '@store/UserStore'
import { useGlobalStore } from '@store/globalStore'
@@ -96,6 +96,16 @@ export default defineComponent({
return myarr
})
watch(() => props.options, (value: any, oldval: any) => {
valori.value = valoriload.value
},
)
watch(() => props.value, (value: any, oldval: any) => {
mounted()
},
)
function changeval(newval: any) {
if (props.tablesel === shared_consts.TAB_COUNTRY)
myvalue.value = newval && newval['value'] ? newval['value'] : newval
@@ -113,19 +123,11 @@ export default defineComponent({
if (props.options) {
const rec: any = props.options.find((myrec: any) => myrec[`${props.optval}`] === props.value)
/*console.log('rec', rec, 'props.useinput', props.useinput)
console.log('props.value', props.value)
console.log('options', props.options)
console.log('optval', props.optval)
console.log('optlab', props.optlab)*/
if (rec) {
if (props.funcgetvaluebyid)
myvalue.value = props.funcgetvaluebyid(rec[`${props.optval}`])
else
myvalue.value = rec[`${props.optlab}`]
// console.log('myvalue', myvalue, 'optval', props.optval, 'rec', rec[`${props.optval}`])
} else {
if (!props.useinput) {
if (props.value) {

View File

@@ -78,7 +78,8 @@
options-selected-class="text-deep-orange"
map-options
v-bind="$attrs"
style="min-width: 170px; max-width: 400px;">
class="combowidth"
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section avatar>