refactor: refs #8409 use defineModel instead or defineProps
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2025-01-29 11:58:19 +01:00
parent 3aa8acf02a
commit 613ebc0eb4
1 changed files with 3 additions and 9 deletions

View File

@ -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"