mirror of
https://github.com/youzan/vant.git
synced 2026-05-05 01:00:55 +08:00
[new feature] Tabs: add animated props to change tabs with animation (#2126)
This commit is contained in:
+11
-3
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user