diff --git a/examples/routers/tabs.vue b/examples/routers/tabs.vue index e18eb4a..43cee49 100644 --- a/examples/routers/tabs.vue +++ b/examples/routers/tabs.vue @@ -9,8 +9,8 @@ </Col> <Col :span="12"> <Tabs type="card" closable @on-tab-remove="handleTagRemove"> - <Tab-pane :label="tab.label" v-for="tab of tabs">{{tab.content}}</Tab-pane> - <Button size="small" slot="right" @click="addTab">添加</Button> + <Tab-pane :label="tab.label" v-for="tab of tabs" :key="tab">{{tab.content}}</Tab-pane> + <Button size="small" slot="extra" @click="addTab">添加</Button> </Tabs> </Col> </Row> diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index e1c4146..b883f34 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -12,7 +12,7 @@ <Icon v-if="showClose(item)" type="ios-close-empty" @click.native.stop="handleRemove(index)"></Icon> </div> </div> - <div :class="[prefixCls + '-nav-right']" v-if="showSlot"><slot name="right"></slot></div> + <div :class="[prefixCls + '-nav-right']" v-if="showSlot"><slot name="extra"></slot></div> </div> </div> </div> @@ -61,7 +61,7 @@ barWidth: 0, barOffset: 0, activeKey: this.value, - showSlot:false + showSlot: false }; }, computed: { @@ -228,8 +228,8 @@ this.updateStatus(); } }, - mounted(){ - this.showSlot = this.$slots.default !== undefined; + mounted () { + this.showSlot = this.$slots.extra !== undefined; } }; </script> -- libgit2 0.21.4