refactor(仪表版): Tab组件轮播时间和轮播顺序优化

This commit is contained in:
wangjiahao 2022-11-24 18:24:51 +08:00
parent 20037f3f32
commit e014b26ebb
2 changed files with 11 additions and 2 deletions

View File

@ -470,8 +470,8 @@ export default {
let switchCount = 1
//
this.timer = setInterval(() => {
switchCount++
const nowIndex = switchCount % this.element.options.tabList.length
switchCount++
this.activeTabName = this.element.options.tabList[nowIndex].name
}, switchTime)
}

View File

@ -135,8 +135,9 @@
type="number"
size="mini"
:min="2"
:max="3600"
class="hide-icon-number"
@change="styleChange"
@change="switchTimeChange"
>
<template slot="append">S</template>
</el-input>
@ -180,6 +181,14 @@ export default {
const current = this.$refs[pickKey]
current && (current.showPicker = true)
},
switchTimeChange() {
if (!this.styleInfo.switchTime || this.styleInfo.switchTime < 2) {
this.styleInfo.switchTime = 2
} else if (this.styleInfo.switchTime && this.styleInfo.switchTime > 3600) {
this.styleInfo.switchTime = 3600
}
this.styleChange()
},
styleChange() {
this.$store.commit('canvasChange')
}