File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
src/components/tab-panels Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1313 label: {
1414 type: [String , Number ],
1515 required: true
16+ },
17+ value: {
18+ type: [String , Number ],
19+ default () {
20+ return this .label
21+ }
1622 }
1723 },
1824 mounted () {
Original file line number Diff line number Diff line change 55 <cube-tab-panel
66 v-for =" (item, index) in data"
77 :label =" item.label"
8- :key =" item.label" >
8+ :value =" item.value"
9+ :key =" item.value || item.label" >
910 {{item.label}}
1011 </cube-tab-panel >
1112 </slot >
4243 this ._move (this .value )
4344 },
4445 methods: {
45- _move (label ) {
46- const curIndex = findIndex (this .panels , panel => panel .label === label )
46+ _move (value ) {
47+ const curIndex = findIndex (this .panels , panel => panel .value === value )
4748 /* istanbul ignore if */
4849 if (curIndex === INDEX_OUT_OF_BOUNDARY ) {
4950 return
You can’t perform that action at this time.
0 commit comments