Commit cd92d87821db6d3e356c72e8dac3f9ceac200807

Authored by 梁灏
1 parent 9f5a643a

fixed #1482

examples/routers/tooltip.vue
1 1 <template>
2 2 <div>
3   - <Tooltip always placement="top" transfer content="Tooltip 文字提示" :delay="1000">
  3 + <Tooltip always placement="top" transfer :content="text" :delay="1000">
4 4 <Button @click="disabled = true">延时1秒显示</Button>
5 5 </Tooltip>
6   - <Tooltip placement="top" transfer content="Tooltip 文字提示">
7   - <Button @click="disabled = true">延时1秒显示</Button>
  6 + <Tooltip placement="top" transfer :content="text">
  7 + <Button @click="handleChange">change</Button>
8 8 </Tooltip>
  9 + <Button @click="handleChange">change</Button>
9 10 </div>
10 11 </template>
11 12 <script>
12 13 export default {
13   -
  14 + data () {
  15 + return {
  16 + text: 'Tooltip 文字提示'
  17 + };
  18 + },
  19 + methods: {
  20 + handleChange () {
  21 + this.text = '提示'
  22 + }
  23 + }
14 24 }
15 25 </script>
... ...
src/components/tooltip/tooltip.vue
... ... @@ -68,6 +68,11 @@
68 68 prefixCls: prefixCls
69 69 };
70 70 },
  71 + watch: {
  72 + content () {
  73 + this.updatePopper();
  74 + }
  75 + },
71 76 methods: {
72 77 handleShowPopper() {
73 78 if (this.timeout) clearTimeout(this.timeout);
... ...