fix: use vue3 v-model bindings
see: https://v3.vuejs.org/guide/migration/v-model.html
This commit is contained in:
parent
2ef2bb7700
commit
51a740f53c
29 changed files with 114 additions and 96 deletions
|
|
@ -37,7 +37,7 @@ export default {
|
|||
}
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
modelValue: {
|
||||
default: () => [],
|
||||
validator: prop => {
|
||||
// This allows arrays of Dates and strings
|
||||
|
|
@ -61,14 +61,15 @@ export default {
|
|||
default: false,
|
||||
},
|
||||
},
|
||||
emits: ['update:modelValue', 'change'],
|
||||
components: {
|
||||
datepicker,
|
||||
},
|
||||
mounted() {
|
||||
this.reminders = this.value
|
||||
this.reminders = this.modelValue
|
||||
},
|
||||
watch: {
|
||||
value(newVal) {
|
||||
modelValue(newVal) {
|
||||
for (const i in newVal) {
|
||||
if (typeof newVal[i] === 'string') {
|
||||
newVal[i] = new Date(newVal[i])
|
||||
|
|
@ -79,7 +80,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
updateData() {
|
||||
this.$emit('input', this.reminders)
|
||||
this.$emit('update:modelValue', this.reminders)
|
||||
this.$emit('change')
|
||||
},
|
||||
addReminderDate(index = null) {
|
||||
|
|
|
|||
Reference in a new issue