forked from github/dataease
Merge pull request #3862 from dataease/pr@dev@refactor_tab-carousel
refactor(仪表版): Tab组件轮播时间和轮播顺序优化
This commit is contained in:
commit
5c4dadfd49
@ -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)
|
||||
}
|
||||
|
@ -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')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user