Commit 88bb7c923df896817853d63223aed465f8c2f918
1 parent
9699c270
fix bug of Poptip
fix bug of Poptip
Showing
3 changed files
with
23 additions
and
11 deletions
Show diff stats
components/poptip/poptip.vue
@@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
26 | </div> | 26 | </div> |
27 | </div> | 27 | </div> |
28 | <div :class="[`${prefixCls}-inner`]" v-if="!confirm"> | 28 | <div :class="[`${prefixCls}-inner`]" v-if="!confirm"> |
29 | - <div :class="[`${prefixCls}-title`]" v-if="!!title"><slot name="title">{{ title }}</slot></div> | 29 | + <div :class="[`${prefixCls}-title`]" v-if="showTitle" v-el:title><slot name="title">{{ title }}</slot></div> |
30 | <div :class="[`${prefixCls}-body`]"><slot name="content">{{ content }}</slot></div> | 30 | <div :class="[`${prefixCls}-body`]"><slot name="content">{{ content }}</slot></div> |
31 | </div> | 31 | </div> |
32 | </div> | 32 | </div> |
@@ -83,7 +83,8 @@ | @@ -83,7 +83,8 @@ | ||
83 | }, | 83 | }, |
84 | data () { | 84 | data () { |
85 | return { | 85 | return { |
86 | - prefixCls: prefixCls | 86 | + prefixCls: prefixCls, |
87 | + showTitle: true | ||
87 | } | 88 | } |
88 | }, | 89 | }, |
89 | computed: { | 90 | computed: { |
@@ -157,6 +158,11 @@ | @@ -157,6 +158,11 @@ | ||
157 | this.visible = false; | 158 | this.visible = false; |
158 | this.$emit('on-ok'); | 159 | this.$emit('on-ok'); |
159 | } | 160 | } |
161 | + }, | ||
162 | + ready () { | ||
163 | + if (!this.confirm) { | ||
164 | + this.showTitle = this.$els.title.innerHTML != ''; | ||
165 | + } | ||
160 | } | 166 | } |
161 | } | 167 | } |
162 | </script> | 168 | </script> |
163 | \ No newline at end of file | 169 | \ No newline at end of file |
local/routers/notice.vue
@@ -15,18 +15,24 @@ | @@ -15,18 +15,24 @@ | ||
15 | <!--<Poptip title="标题" content="内容" trigger="hover">--> | 15 | <!--<Poptip title="标题" content="内容" trigger="hover">--> |
16 | <!--<Button>hover 触发</Button>--> | 16 | <!--<Button>hover 触发</Button>--> |
17 | <!--</Poptip>--> | 17 | <!--</Poptip>--> |
18 | - <Poptip title="确定删除这条信息吗?" content="内容" trigger="focus" @on-ok="ok" @on-cancel="cancel" ok-text="yes" cancel-text="no" width="200"> | ||
19 | - <a>Delete</a> | ||
20 | - </Poptip> | ||
21 | - <Poptip title="标题" content="内容" trigger="focus"> | ||
22 | - <input type="text"> | 18 | + <Poptip title="确定删除这条信息吗?" confirm content="内容" trigger="focus" @on-ok="ok" @on-cancel="cancel"> |
19 | + <a><strong>Delete</strong></a> | ||
23 | </Poptip> | 20 | </Poptip> |
24 | <!--<Poptip title="标题" content="内容" trigger="focus">--> | 21 | <!--<Poptip title="标题" content="内容" trigger="focus">--> |
22 | + <!--<input type="text">--> | ||
23 | + <!--</Poptip>--> | ||
24 | + <!--<Poptip title="标题" content="内容" trigger="focus">--> | ||
25 | <!--<Button>focus 触发</Button>--> | 25 | <!--<Button>focus 触发</Button>--> |
26 | <!--</Poptip>--> | 26 | <!--</Poptip>--> |
27 | - <Tooltip content="这里是提示文字"> | ||
28 | - 当鼠标经过这段文字时,会显示一个气泡框 | ||
29 | - </Tooltip> | 27 | + <!--<Tooltip content="这里是提示文字">--> |
28 | + <!--当鼠标经过这段文字时,会显示一个气泡框--> | ||
29 | + <!--</Tooltip>--> | ||
30 | + <Poptip> | ||
31 | + <a>click 激活</a> | ||
32 | + <div slot="content"> | ||
33 | + <a>关闭提示框</a> | ||
34 | + </div> | ||
35 | + </Poptip> | ||
30 | </div> | 36 | </div> |
31 | </template> | 37 | </template> |
32 | <script> | 38 | <script> |
package.json
1 | { | 1 | { |
2 | "name": "iview", | 2 | "name": "iview", |
3 | - "version": "0.9.5-rc-6", | 3 | + "version": "0.9.5-rc-7", |
4 | "title": "iView", | 4 | "title": "iView", |
5 | "description": "A high quality UI components Library with Vue.js", | 5 | "description": "A high quality UI components Library with Vue.js", |
6 | "homepage": "http://www.iviewui.com", | 6 | "homepage": "http://www.iviewui.com", |