提交 46d418ce 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

types(interceptor): 修复类型错误

上级 959692de
......@@ -8,7 +8,7 @@
<button class="navigatorButton">navigator组件跳转到测试页面</button>
</navigator>
<button @click="addSwitchTabInterceptor">添加switchTab拦截器</button>
<button @click="removeSwitchTabInterceptor">移除switchTab拦截器</button>
<button @click="removeSwitchTabInterceptor">移除switchTab拦截器</button>
<button class="navigatorButton" @click="switchTab">switchTab API</button>
</view>
</template>
......@@ -32,7 +32,7 @@
complete: function (res : NavigateToComplete) {
console.log('拦截 navigateTo 接口 complete 返回参数为:', res)
}
} as Interceptor
} as AddInterceptorOptions
const switchTabInterceptor = {
invoke: function (options : SwitchTabOptions) {
......@@ -48,7 +48,7 @@
complete: function (res : SwitchTabComplete) {
console.log('拦截 switchTab 接口 complete 返回参数为:', res)
}
} as Interceptor
} as AddInterceptorOptions
export default {
data() {
......@@ -75,12 +75,12 @@
title: '拦截器已移除'
})
this.msg = "会跳转到测试页面1"
},
addSwitchTabInterceptor() {
uni.addInterceptor('switchTab', switchTabInterceptor)
},
removeSwitchTabInterceptor() {
uni.removeInterceptor('switchTab', switchTabInterceptor)
},
addSwitchTabInterceptor() {
uni.addInterceptor('switchTab', switchTabInterceptor)
},
removeSwitchTabInterceptor() {
uni.removeInterceptor('switchTab', switchTabInterceptor)
},
navigateTo() {
uni.navigateTo({
......@@ -112,4 +112,4 @@
}
}
}
</script>
</script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册