UNPKG

press-plus

Version:
40 lines (31 loc) 780 B
## 页面切换动画 接入方式,在 `App.vue` 中 `onLaunch` 方法中增加拦截。 ```ts // #ifdef H5 import { pageAnimation } from 'press-plus/common/page-animation/index'; import { hookVueRouter } from 'press-plus/common/page-animation/hook-vue-router'; // #endif onLaunch(() => { // #ifdef H5 pageAnimation({ router: this.$router, }); hookVueRouter(this.$router, { log: process.env.NODE_ENV === 'development', }); // #endif }) ``` `Vue2` 有点不同: ```ts initPageAnimation() { pageAnimation({ router: this.$router, selector: '.uni-body', }); hookVueRouter(this.$router, { log: process.env.NODE_ENV === 'development', }); }, ``` 如果不想展示某次跳转的动画,可以在加`query.disableSetNavType = 1`。