[new feature] Tabs: add animated props to change tabs with animation (#2126)

This commit is contained in:
张敏
2018-11-23 19:51:47 +08:00
committed by neverland
parent 8042e37829
commit d84b13a6cc
15 changed files with 2097 additions and 268 deletions
+11 -3
View File
@@ -1,7 +1,8 @@
<template>
<div
:class="b('pane')"
v-show="isSelected"
:class="b('pane', { float: parent.animated })"
v-show="parent.animated || isSelected"
:style="paneStyle"
>
<slot v-if="inited" />
<div
@@ -29,7 +30,8 @@ export default create({
data() {
return {
inited: false
inited: false,
paneStyle: {}
};
},
@@ -48,6 +50,12 @@ export default create({
this.inited = this.inited || this.isSelected;
},
'parent.computedWidth'(width) {
this.paneStyle = {
width: `${width}px`
};
},
title() {
this.parent.setLine();
}