好的文章链接
https://www.jianshu.com/p/9d7e9e965411
1. 路由的定义
module.exports = new Router({
routes: [
{
path: '/',
name: 'main',
component: main
},
{
path: '/category-third',
name: 'categorys_third',
component: categorys_third
},
]
})
2. 路由的跳转
this.$router.push({
name:'categorys_third',
params:{
category:param.code,
title:param.name
}
})
3. 参数的接受
4. 小程序跳转webview注意的事项
a. 参数如果传递过去接收问题
通过URL传参数过去的参数值建议使用BASE64 加密后传输 (尤其是值含有 ‘中文’,‘符号’,‘http’ 的内容)
试过使用 encodeURI, encodeURLComment ,escape 编码都会导出web-view有白屏的现象出现。
另外webview 加载的页面 缓存问题很严重。通过 发现---小程序---删除 并不能删除webview 页面的缓存数据。 建议加载版本号 ?r=xxx