选择职务组件v-model方式绑定值不生效

pull/474/merge
zhangdaiscott 2023-05-17 21:48:22 +08:00
parent 2e8c754559
commit 21e9e88dc6
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,7 @@
default: () => {}, default: () => {},
}, },
}, },
emits: ['options-change', 'change'], emits: ['options-change', 'change', 'update:value'],
setup(props, { emit, refs }) { setup(props, { emit, refs }) {
const emitData = ref<any[]>(); const emitData = ref<any[]>();
//model //model
@ -108,6 +108,10 @@
//emitData.value = values.join(","); //emitData.value = values.join(",");
state.value = values; state.value = values;
selectValues.value = values; selectValues.value = values;
//update-begin-author:liusq date:20230517 for:v-model
emit('update:value', values.join(','));
//update-begin-author:liusq date:20230517 for:v-model
} }
const getBindValue = Object.assign({}, unref(props), unref(attrs)); const getBindValue = Object.assign({}, unref(props), unref(attrs));