Commit cd92d87821db6d3e356c72e8dac3f9ceac200807
1 parent
9f5a643a
fixed #1482
Showing
2 changed files
with
19 additions
and
4 deletions
Show diff stats
examples/routers/tooltip.vue
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | - <Tooltip always placement="top" transfer content="Tooltip 文字提示" :delay="1000"> | 3 | + <Tooltip always placement="top" transfer :content="text" :delay="1000"> |
4 | <Button @click="disabled = true">延时1秒显示</Button> | 4 | <Button @click="disabled = true">延时1秒显示</Button> |
5 | </Tooltip> | 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 | </Tooltip> | 8 | </Tooltip> |
9 | + <Button @click="handleChange">change</Button> | ||
9 | </div> | 10 | </div> |
10 | </template> | 11 | </template> |
11 | <script> | 12 | <script> |
12 | export default { | 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 | </script> | 25 | </script> |
src/components/tooltip/tooltip.vue
@@ -68,6 +68,11 @@ | @@ -68,6 +68,11 @@ | ||
68 | prefixCls: prefixCls | 68 | prefixCls: prefixCls |
69 | }; | 69 | }; |
70 | }, | 70 | }, |
71 | + watch: { | ||
72 | + content () { | ||
73 | + this.updatePopper(); | ||
74 | + } | ||
75 | + }, | ||
71 | methods: { | 76 | methods: { |
72 | handleShowPopper() { | 77 | handleShowPopper() { |
73 | if (this.timeout) clearTimeout(this.timeout); | 78 | if (this.timeout) clearTimeout(this.timeout); |