add Poptip component

add Poptip component
This commit is contained in:
梁灏 2016-10-27 10:30:32 +08:00
parent 4dfacfca66
commit 9699c270dc
14 changed files with 420 additions and 120 deletions

View file

@ -28,22 +28,21 @@ export default {
boundariesElement: 'body'
}
}
},
visible: {
type: Boolean,
default: false
}
},
data() {
return {
showPopper: false
};
},
watch: {
value: {
immediate: true,
handler(val) {
this.showPopper = val;
this.visible = val;
this.$emit('input', val);
}
},
showPopper(val) {
visible(val) {
val ? this.updatePopper() : this.destroyPopper();
this.$emit('input', val);
}
@ -78,7 +77,7 @@ export default {
this.popperJS ? this.popperJS.update() : this.createPopper();
},
doDestroy() {
if (this.showPopper) return;
if (this.visible) return;
this.popperJS.destroy();
this.popperJS = null;
},