diff --git a/CHANGE.md b/CHANGE.md index 0c2bb39..e44ee93 100644 --- a/CHANGE.md +++ b/CHANGE.md @@ -27,4 +27,5 @@ class 改为了 className ### Circle 改名为 iCircle ### Tabs -废弃 activeKey,改用 value,使用 v-model,key 更名为 name \ No newline at end of file +废弃 activeKey,改用 value,使用 v-model,key 更名为 name +### popper.js 将 prop: visible 移至 data 里 \ No newline at end of file diff --git a/README.md b/README.md index 3d60c39..1804c88 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ - [x] Collapse - [x] Timeline - [x] Tag -- [ ] Tooltip +- [x] Tooltip - [ ] Poptip - [x] Carousel - [x] Tree diff --git a/src/components/base/popper.js b/src/components/base/popper.js index 5dd8aa2..8373e1d 100644 --- a/src/components/base/popper.js +++ b/src/components/base/popper.js @@ -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; diff --git a/src/components/tooltip/tooltip.vue b/src/components/tooltip/tooltip.vue index 563ebeb..d064f7c 100644 --- a/src/components/tooltip/tooltip.vue +++ b/src/components/tooltip/tooltip.vue @@ -1,14 +1,16 @@ -- libgit2 0.21.4