Commit 8e7ac21077def48f51bb6f213a52af9c68e6bce0
1 parent
8b73f45b
fixed #1222
Showing
4 changed files
with
16 additions
and
4 deletions
Show diff stats
examples/components/table.vue
examples/components/test.vue
@@ -7,10 +7,10 @@ | @@ -7,10 +7,10 @@ | ||
7 | row: Object | 7 | row: Object |
8 | }, | 8 | }, |
9 | mounted () { | 9 | mounted () { |
10 | - console.log(1); | 10 | +// console.log(1); |
11 | }, | 11 | }, |
12 | beforeDestroy () { | 12 | beforeDestroy () { |
13 | - console.log(2); | 13 | +// console.log(2); |
14 | } | 14 | } |
15 | } | 15 | } |
16 | </script> | 16 | </script> |
17 | \ No newline at end of file | 17 | \ No newline at end of file |
examples/routers/poptip.vue
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | + <Poptip trigger="hover" title="提示标题" content="提示内容"> | ||
4 | + <Button>hover 激活</Button> | ||
5 | + </Poptip> | ||
6 | + <Poptip title="提示标题" content="提示内容"> | ||
7 | + <Button>click 激活</Button> | ||
8 | + </Poptip> | ||
9 | + <Poptip trigger="focus" title="提示标题" content="提示内容"> | ||
10 | + <Button>focus 激活</Button> | ||
11 | + </Poptip> | ||
3 | <Poptip trigger="focus" title="提示标题" content="提示内容"> | 12 | <Poptip trigger="focus" title="提示标题" content="提示内容"> |
4 | <i-input placeholder="输入框的 focus"></i-input> | 13 | <i-input placeholder="输入框的 focus"></i-input> |
5 | </Poptip> | 14 | </Poptip> |
src/components/poptip/poptip.vue
@@ -194,14 +194,14 @@ | @@ -194,14 +194,14 @@ | ||
194 | mounted () { | 194 | mounted () { |
195 | if (!this.confirm) { | 195 | if (!this.confirm) { |
196 | // this.showTitle = this.$refs.title.innerHTML != `<div class="${prefixCls}-title-inner"></div>`; | 196 | // this.showTitle = this.$refs.title.innerHTML != `<div class="${prefixCls}-title-inner"></div>`; |
197 | - this.showTitle = this.$slots.title !== undefined; | 197 | + this.showTitle = (this.$slots.title !== undefined) || this.title; |
198 | } | 198 | } |
199 | // if trigger and children is input or textarea,listen focus & blur event | 199 | // if trigger and children is input or textarea,listen focus & blur event |
200 | if (this.trigger === 'focus') { | 200 | if (this.trigger === 'focus') { |
201 | - this.isInput = true; | ||
202 | this.$nextTick(() => { | 201 | this.$nextTick(() => { |
203 | const $children = this.getInputChildren(); | 202 | const $children = this.getInputChildren(); |
204 | if ($children) { | 203 | if ($children) { |
204 | + this.isInput = true; | ||
205 | $children.addEventListener('focus', this.handleFocus, false); | 205 | $children.addEventListener('focus', this.handleFocus, false); |
206 | $children.addEventListener('blur', this.handleBlur, false); | 206 | $children.addEventListener('blur', this.handleBlur, false); |
207 | } | 207 | } |