提交 20ed73d3 编写于 作者: Q qiang

fix: 更新拦截器示例,页面销毁时移除拦截器

# Conflicts:
#	pages/API/interceptor/interceptor.uvue
上级 857441e1
...@@ -27,9 +27,13 @@ ...@@ -27,9 +27,13 @@
export default { export default {
data() { data() {
return { return {
msg:"会跳转到测试页面1" msg: "会跳转到测试页面1"
} }
}, },
beforeUnmount() {
// 移除 navigateTo 所有拦截器
uni.removeInterceptor('navigateTo')
},
methods: { methods: {
addInterceptor() { addInterceptor() {
uni.addInterceptor('navigateTo', interceptor) uni.addInterceptor('navigateTo', interceptor)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册