fixed #185
This commit is contained in:
梁灏 2017-01-11 15:41:23 +08:00
parent 12bd19d7a8
commit 0c5e01f1a8
2 changed files with 9 additions and 10 deletions

View file

@ -172,7 +172,6 @@
const nav = this.navList[index];
if (nav.disabled) return;
this.activeKey = nav.key;
this.updateStatus();
this.$emit('on-click', nav.key);
},
handleRemove (index) {
@ -205,6 +204,7 @@
watch: {
activeKey () {
this.updateBar();
this.updateStatus();
}
}
};

View file

@ -1,22 +1,21 @@
<template>
<i-button @click="add">add</i-button>{{more}}
<Tabs active-key="key1" type="card" closable>
<tab-pane label="标签一" key="key1">标签一的内容</tab-pane>
<tab-pane label="标签二" key="key2">标签二的内容</tab-pane>
<tab-pane label="标签三" key="key3">标签三的内容</tab-pane>
<tab-pane label="标签四" key="key4" v-if="more">标签四的内容</tab-pane>
<Tabs :active-key.sync="activeKey" :animated="true">
<Tab-pane label="标签一" key="key1">标签一的内容</Tab-pane>
<Tab-pane label="标签二" key="key2">标签二的内容</Tab-pane>
<Tab-pane label="标签三" key="key3">标签三的内容</Tab-pane>
</Tabs>
<i-button @click="change">change</i-button>
</template>
<script>
export default {
data () {
return {
more: false
activeKey: 'key2'
}
},
methods: {
add () {
this.more = !this.more;
change () {
this.activeKey = 'key1';
}
}
}