邓洁 : 隧道切换效果

This commit is contained in:
邓洁
2023-12-09 01:04:10 +08:00
parent e7405fcf00
commit 5663c9338f
2 changed files with 86 additions and 22 deletions

View File

@@ -50,15 +50,20 @@
<div v-if="drawerRight" class="right-arrow" @click="closeRight"></div>
<div v-else class="shrink-right" @click="closeRight"></div>
</div>
<div class="switch-btn">
<div class="arrow"></div>
<div class="btn">
<div>一号隧道</div>
<div>二号隧道</div>
<div>三号隧道</div>
</div>
<div class="arrow right"></div>
<div class="arrow" @click="previousBtn"></div>
<el-carousel height="150px" type="card" ref="tunnelBtn" :autoplay="false">
<div class="btn">
<el-carousel-item v-for="(item,index) in tunnelList" :key="item.value">
{{ item.name }}
</el-carousel-item>
</div>
</el-carousel>
<div class="arrow right" @click="nextBtn"></div>
</div>
</div>
</template>
@@ -76,13 +81,37 @@ import {useAuthStore} from '@/store/userstore.js'
const authStore = useAuthStore()
const router = useRouter()
const selectIndex=ref(1)
const selectIndex = ref(1)
const drawerLeft = ref(true)
const drawerRight = ref(true)
const currentSite = ref('松江站')
const currentUser = ref('admin')
const currentDate = ref(dateFormat())
const tunnelBtn=ref()
const tunnelList = ref([
{
value: 0,
name: '一号隧道'
}, {
value: 1,
name: '二号隧道'
}, {
value: 2,
name: '三号隧道'
}, {
value: 3,
name: '四号隧道'
}, {
value: 4,
name: '五号隧道'
}, {
value: 5,
name: '六号隧道'
}, {
value: 6,
name: '七号隧道'
},
])
const manageSelect = () => {
// getInfo();
};
@@ -96,6 +125,14 @@ const handleLogout = () => {
authStore.userLogout()
router.push('/login')
}
const previousBtn = () => {
tunnelBtn.value.prev()
}
const nextBtn = () => {
tunnelBtn.value.next();
// tunnelList.value.push(tunnelList.value.shift())
// console.log('tunnelList.value', tunnelList.value)
}
</script>
<style lang="scss" scoped>