parent
c9985ada18
commit
5b143a2b3f
3 changed files with 22 additions and 39 deletions
|
@ -30,6 +30,11 @@
|
|||
tab: {
|
||||
type: String
|
||||
},
|
||||
// 在 TabPane 使用 v-if 时,并不会按照预先的顺序渲染,这时可设置 index,并从小到大排序
|
||||
// 数值需大于 0
|
||||
index: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
|
|
@ -187,6 +187,14 @@
|
|||
}
|
||||
});
|
||||
|
||||
// 在 TabPane 使用 v-if 时,并不会按照预先的顺序渲染,这时可设置 index,并从小到大排序
|
||||
TabPanes.sort((a, b) => {
|
||||
if (a.index && b.index) {
|
||||
return a.index > b.index ? 1 : -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
return TabPanes;
|
||||
},
|
||||
updateNav () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue