refactor: refs #8409 use defineModel instead or defineProps
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
3aa8acf02a
commit
613ebc0eb4
|
@ -2,17 +2,11 @@
|
|||
import { computed } from 'vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
const $props = defineProps({
|
||||
modelValue: {
|
||||
type: [String, Number, Object],
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
const model = defineModel({ type: [String, Number, Object] });
|
||||
const url = 'Suppliers';
|
||||
const value = computed({
|
||||
get() {
|
||||
return $props.modelValue;
|
||||
return model;
|
||||
},
|
||||
set(val) {
|
||||
emit('update:modelValue', val);
|
||||
|
@ -24,7 +18,7 @@ const value = computed({
|
|||
<VnSelect
|
||||
:label="$t('globals.supplier')"
|
||||
v-bind="$attrs"
|
||||
v-model="value"
|
||||
v-model="model"
|
||||
:url="url"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
|
|
Loading…
Reference in New Issue