Commit 8e4f708f254db4600751853ea984d1685817feb5
1 parent
02fa0d3f
update Tabs
@hezhiying
Showing
2 changed files
with
6 additions
and
6 deletions
Show diff stats
examples/routers/tabs.vue
@@ -9,8 +9,8 @@ | @@ -9,8 +9,8 @@ | ||
9 | </Col> | 9 | </Col> |
10 | <Col :span="12"> | 10 | <Col :span="12"> |
11 | <Tabs type="card" closable @on-tab-remove="handleTagRemove"> | 11 | <Tabs type="card" closable @on-tab-remove="handleTagRemove"> |
12 | - <Tab-pane :label="tab.label" v-for="tab of tabs">{{tab.content}}</Tab-pane> | ||
13 | - <Button size="small" slot="right" @click="addTab">添加</Button> | 12 | + <Tab-pane :label="tab.label" v-for="tab of tabs" :key="tab">{{tab.content}}</Tab-pane> |
13 | + <Button size="small" slot="extra" @click="addTab">添加</Button> | ||
14 | </Tabs> | 14 | </Tabs> |
15 | </Col> | 15 | </Col> |
16 | </Row> | 16 | </Row> |
src/components/tabs/tabs.vue
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <Icon v-if="showClose(item)" type="ios-close-empty" @click.native.stop="handleRemove(index)"></Icon> | 12 | <Icon v-if="showClose(item)" type="ios-close-empty" @click.native.stop="handleRemove(index)"></Icon> |
13 | </div> | 13 | </div> |
14 | </div> | 14 | </div> |
15 | - <div :class="[prefixCls + '-nav-right']" v-if="showSlot"><slot name="right"></slot></div> | 15 | + <div :class="[prefixCls + '-nav-right']" v-if="showSlot"><slot name="extra"></slot></div> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
18 | </div> | 18 | </div> |
@@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
61 | barWidth: 0, | 61 | barWidth: 0, |
62 | barOffset: 0, | 62 | barOffset: 0, |
63 | activeKey: this.value, | 63 | activeKey: this.value, |
64 | - showSlot:false | 64 | + showSlot: false |
65 | }; | 65 | }; |
66 | }, | 66 | }, |
67 | computed: { | 67 | computed: { |
@@ -228,8 +228,8 @@ | @@ -228,8 +228,8 @@ | ||
228 | this.updateStatus(); | 228 | this.updateStatus(); |
229 | } | 229 | } |
230 | }, | 230 | }, |
231 | - mounted(){ | ||
232 | - this.showSlot = this.$slots.default !== undefined; | 231 | + mounted () { |
232 | + this.showSlot = this.$slots.extra !== undefined; | ||
233 | } | 233 | } |
234 | }; | 234 | }; |
235 | </script> | 235 | </script> |