diff --git a/package.json b/package.json index 7db09140..c4410942 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ ], "dependencies": {}, "peerDependencies": { - "vue": "^2.6.10" + "vue": "^3.0.0" }, "devDependencies": { "@babel/cli": "^7.4.4", diff --git a/src/components/Datepicker.vue b/src/components/Datepicker.vue index 67055bef..ded3ed12 100644 --- a/src/components/Datepicker.vue +++ b/src/components/Datepicker.vue @@ -108,7 +108,7 @@ export default { PickerYear }, props: { - value: { + modelValue: { validator: val => utils.validateDateInput(val) }, name: String, @@ -187,7 +187,7 @@ export default { } }, watch: { - value (value) { + modelValue (value) { this.setValue(value) }, openDate () { @@ -331,7 +331,7 @@ export default { this.selectedDate = date this.setPageDate(date) this.$emit('selected', date) - this.$emit('input', date) + this.$emit('update:modelValue', date) }, /** * Clear the selected date @@ -340,7 +340,7 @@ export default { this.selectedDate = null this.setPageDate() this.$emit('selected', null) - this.$emit('input', null) + this.$emit('update:modelValue', null) this.$emit('cleared') }, /** @@ -445,8 +445,8 @@ export default { * Initiate the component */ init () { - if (this.value) { - this.setValue(this.value) + if (this.modelValue) { + this.setValue(this.modelValue) } if (this.isInline) { this.setInitialView()