简体中文
添加拦截器
名称 | 类型 | 必填 | 默认值 | 描述 |
---|---|---|---|---|
name | string | 是 | - | 需要拦截的 API 名称 |
interceptor | Interceptor | 是 | - | 拦截器 |
Android | iOS | web |
---|---|---|
3.97 | 4.11 | 4.0 |
删除拦截器
名称 | 类型 | 必填 | 默认值 | 描述 |
---|---|---|---|---|
name | string | 是 | - | 需要删除拦截器的 API 名称 |
interceptor | Interceptor | null | 否 | - | 拦截器 |
Android | iOS | web |
---|---|---|
3.97 | 4.11 | 4.0 |
Template
Script
<template>
<view style="flex: 1;">
<button @click="addInterceptor">添加路由拦截器</button>
<button @click="removeInterceptor">移除路由拦截器</button>
<text>点击下方按钮{{msg}}</text>
<button @click="navigateTo">跳转到测试页面</button>
</view>
</template>
<style>
</style>
名称 | 类型 | 必备 | 默认值 | 描述 |
---|---|---|---|---|
errMsg | string | 是 | - | 错误信息 |