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
examples/routers/poptip.vue
1 | 1 | <template> |
2 | 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 | 12 | <Poptip trigger="focus" title="提示标题" content="提示内容"> |
4 | 13 | <i-input placeholder="输入框的 focus"></i-input> |
5 | 14 | </Poptip> | ... | ... |
src/components/poptip/poptip.vue
... | ... | @@ -194,14 +194,14 @@ |
194 | 194 | mounted () { |
195 | 195 | if (!this.confirm) { |
196 | 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 | 199 | // if trigger and children is input or textarea,listen focus & blur event |
200 | 200 | if (this.trigger === 'focus') { |
201 | - this.isInput = true; | |
202 | 201 | this.$nextTick(() => { |
203 | 202 | const $children = this.getInputChildren(); |
204 | 203 | if ($children) { |
204 | + this.isInput = true; | |
205 | 205 | $children.addEventListener('focus', this.handleFocus, false); |
206 | 206 | $children.addEventListener('blur', this.handleBlur, false); |
207 | 207 | } | ... | ... |