vue-bootstrap-modal
vue-bootstrap-modal copied to clipboard
Vue 2.3 compatible
In 2.3 we re-introduced the .sync modifier for props, but this time it is just syntax sugar that automatically expands into an additional v-on listener:
https://vuejs.org/v2/guide/components.html#sync-Modifier
In case to compatible Vue 2.3, ok and cancel methods must be changed to:
methods: {
ok () {
this.$emit('ok')
this.$emit('update:show', false)
},
cancel () {
this.$emit('cancel')
this.$emit('update:show', false)
},
// 点击遮罩层
clickMask () {
if (!this.force) {
this.cancel()
}
}
}
Thank you @thierryxing
@dracon sure thing