1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

refactor: v-model on custom components

This commit is contained in:
2022-04-24 23:10:25 +02:00
parent 4f8bc26349
commit b8e734d827
5 changed files with 15 additions and 15 deletions

View File

@ -27,14 +27,14 @@ import { TEXT, LONG_TEXT } from 'common/fieldTypes';
export default {
name: 'ForeignKeySelect',
props: {
value: [String, Number],
modelValue: [String, Number],
keyUsage: Object,
size: {
type: String,
default: ''
}
},
emits: ['update:value', 'blur'],
emits: ['update:modelValue', 'blur'],
data () {
return {
foreignList: []
@ -46,7 +46,7 @@ export default {
}),
isValidDefault () {
if (!this.foreignList.length) return true;
if (this.value === null) return false;
if (this.modelValue === null) return false;
return this.foreignList.some(foreign => foreign.foreign_column.toString() === this.value.toString());
}
},
@ -92,7 +92,7 @@ export default {
addNotification: 'notifications/addNotification'
}),
onChange () {
this.$emit('update:value', this.$refs.editField.value);
this.$emit('update:modelValue', this.$refs.editField.value);
},
cutText (val) {
if (typeof val !== 'string') return val;