提交 f32441e2 编写于 作者: H hdx

feat(navigator): 增加动画示例

上级 ff995285
......@@ -32,7 +32,8 @@
<view class="uni-btn-v">
<button @tap="navigateTo" class="uni-btn">
跳转新页面,并传递数据
</button>
</button>
<button v-for="(item, _) in animationTypeList" @tap="navigateToAnimationType(item)" class="uni-btn">navigateTo({{item}})</button>
<button @tap="navigateBack" class="uni-btn">返回上一页</button>
<button @tap="redirectTo" class="uni-btn">在当前页面打开</button>
<button @tap="switchTab" class="uni-btn">切换到模板选项卡</button>
......@@ -59,7 +60,18 @@
onLoadTime: 0,
onShowTime: 0,
onReadyTime: 0,
onHideTime: 0,
onHideTime: 0,
animationTypeList: [
'slide-in-right',
'slide-in-left',
'slide-in-top',
'slide-in-bottom',
'pop-in',
'fade-in',
'zoom-out',
'zoom-fade-out',
'none',
]
}
},
onLoad() {
......@@ -109,7 +121,31 @@
},
navigateTo() {
uni.navigateTo({
url: '/pages/API/navigator/new-page/new-page-1?data=Hello',
url: '/pages/API/navigator/new-page/new-page-1?data=Hello',
animationType: 'fade-in',
animationDuration: 200,
success(result) {
console.log('navigateTo success', result.errMsg)
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1)
},
fail(error) {
console.log('navigateTo fail', error.errMsg)
// 自动化测试
setLifeCycleNum(state.lifeCycleNum - 1)
},
complete(result) {
console.log('navigateTo complete', result.errMsg)
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1)
},
})
},
navigateToAnimationType(animationType: string) {
uni.navigateTo({
url: '/pages/API/navigator/new-page/new-page-1?data=Hello',
animationType: animationType,
animationDuration: 200,
success(result) {
console.log('navigateTo success', result.errMsg)
// 自动化测试
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册