support Tooltip

support Tooltip
This commit is contained in:
梁灏 2017-03-03 14:00:16 +08:00
parent 30510c3d9e
commit d6f644e1d9
8 changed files with 44 additions and 88 deletions

View file

@ -18,20 +18,28 @@ export default {
offset: {
default: 0
},
value: Boolean,
value: {
type: Boolean,
default: false
},
transition: String,
options: {
type: Object,
default () {
return {
gpuAcceleration: false,
boundariesElement: 'body'
// boundariesElement: 'body' // todo 暂时注释,发现在 vue 2 里方向暂时可以自动识别了,待验证
};
}
},
visible: {
type: Boolean,
default: false
// visible: {
// type: Boolean,
// default: false
// }
},
data () {
return {
visible: this.value
}
},
watch: {
@ -59,8 +67,8 @@ export default {
}
const options = this.options;
const popper = this.popper || this.$els.popper;
const reference = this.reference || this.$els.reference;
const popper = this.popper || this.$refs.popper;
const reference = this.reference || this.$refs.reference;
if (!popper || !reference) return;