Commit cd255f33 authored by Jenny's avatar Jenny

feat: tabs select default-value

parent 8028086b
......@@ -19,6 +19,7 @@
/>
<u-select
v-model="show"
:default-value="defaultValue"
:list="elementData.dataList.series"
:safe-area-inset-bottom="true"
label-name="name"
......@@ -56,7 +57,8 @@
return {
currentTabs: 0,
show: false,
tabsValue: ''
tabsValue: '',
defaultValue: [0]
};
},
mounted() {
......@@ -87,12 +89,12 @@
'--border-style': `${frameWidth}px ${frameStyle} ${frameColor}`,
'--item-background-color': itemBackgroundColor
}
}
},
methods: {
initChart(index = 0) {
this.currentTabs = index
this.defaultValue = [0]
this.tabsValue = this.elementData.dataList.series[this.currentTabs].value
},
handleTabsChange(index) {
......@@ -101,6 +103,7 @@
},
handleSelectChange(e) {
this.tabsValue = e[0].value
this.defaultValue[0] = [this.elementData.dataList.series.findIndex(item => item.value === e[0].value)]
this.tabsValueChange()
},
handleChangeTabValue(value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment