1. 程式人生 > >vue 移動端,頁面左右頁面切換效果(切換過程中會出現白屏效果,布吉島怎麽優化,後來就發布前就棄用了)

vue 移動端,頁面左右頁面切換效果(切換過程中會出現白屏效果,布吉島怎麽優化,後來就發布前就棄用了)

names out name watch bsp etc () nsf his

<transition name="left">
<router-view v-if="getCms" class="Router"/>
</transition>


data() {
names: ‘left‘
}

watch: {
  ‘$route‘(to, from) {
    if (to.index < from.index) {
      this.names = "right"
    } else {
      this.names = "left"
    }
  }
}


.left-enter {
  transform: translateX(
100%); } .left-enter-to { transform: translateX(0); } .left-enter-active { transition: 1s; } .left-leave { transform: translateX(0); } .left-leave-to { transform: translateX(-100%); } .left-leave-active { transition: .5s; } .right-enter { transform: translateX(-100%); } .right-enter-active { transition: .5s; } .right
-leave-to { transform: translateX(100%); } .right-leave-active { transition: .5s; }

vue 移動端,頁面左右頁面切換效果(切換過程中會出現白屏效果,布吉島怎麽優化,後來就發布前就棄用了)