Coffcer / vue-bootstrap-modal

Bootstrap style modal for vue
148 stars 47 forks source link

Vue 2.3 compatible #12

Open thierryxing opened 7 years ago

thierryxing commented 7 years ago

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()
        }
      }
    }
dracon commented 7 years ago

Thank you @thierryxing

thierryxing commented 7 years ago

@dracon sure thing