myronliu347 / vue-popup-mixin

基于vue开发的popup 的mixins 用于管理弹出框的遮盖层
MIT License
73 stars 23 forks source link

Avoid mutating a prop directly in Vue2.0 #1

Closed karonl closed 7 years ago

karonl commented 7 years ago

In the Vue2.0, I use this vue-popup in my project and get this error message when I close the popup.

 Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "show" 
(found in component <dialogc> at dialogc.vue);

I find that the error caused by "this.show = false" , We can solve through "$emit('close')" and set show false in parent component.

myronliu347 commented 7 years ago

Only use in 1.0

2.0 you can look https://github.com/museui/muse-ui/tree/master/src/internal/popup