优化slide

This commit is contained in:
zyronon 2022-03-23 18:00:58 +08:00
parent 75cddae8c4
commit 0e98422332
2 changed files with 5 additions and 0 deletions

View File

@ -76,6 +76,9 @@ export default {
this.$setCss(this.wrapper, 'transition-duration', `300ms`)
this.$setCss(this.wrapper, 'transform',
`translate3d(${this.getDistance()}px, 0, 0)`)
this.$attrs['onUpdate:index'] && this.$emit('update:index', this.index)
this.reset()
},
reset() {

View File

@ -4,6 +4,7 @@
<div class="item">
<IndicatorHome/>
<slide-horizontal
v-model:index="index"
style="height: calc(100% - 5rem);"
>
<div class="item">
@ -100,6 +101,7 @@ export default {
},
data() {
return {
index: 0,
closeOne: true,
videos: [],
totalSize: 52,