Rachel Cao
Rachel Cao
回答: 2、就是从桌面打开出现启动页,启动页加载完成之后就整个白屏了 3、本地调试就是一切正常的样子 这个应该不需要上传视频了吧, 我的验证方式就是将router挂载到vue上这段代码注释掉只有在重新打包就没问题了
> 是上传一个视频吗? 要求: > > * 1、打包后的APK > * 2、从桌面启动到白屏,或者是白屏结束 > * 3、本地调试也附带一个视频 https://user-images.githubusercontent.com/33114417/147342014-fb395077-1689-4658-9222-07c7e5a5d57b.mp4 补充打开白屏视频
``` import {RouterMount,createRouter} from 'uni-simple-router'; import Vue from 'vue'; const router = createRouter({ platform: process.env.VUE_APP_PLATFORM, routes: [...ROUTES], beforeProxyHooks: { onLoad(options: any, next: any){ // @ts-ignore next([router.currentRoute.query]); }, onShow([options]: any, next:...
> 一直都会白屏吗?是不是路由守卫下某些条件没对所以没next。导致一直在等待页面 ,你检查一下 看下这个资料 > > * [app配置](https://hhyang.cn/v2/start/app/explian.html#%E5%AE%8C%E7%BE%8E%E7%9A%84%E9%85%8D%E7%BD%AE) > * [启动页生命周期](https://hhyang.cn/v2/start/app/start.html#%E5%90%AF%E5%8A%A8%E5%AE%8C%E6%88%90%E5%90%8E%E7%9A%84%E9%92%A9%E5%AD%90) 对的, 就怎么打开都是白屏, 路由守卫也只用了后置的,没用前置的,所有没有next()的事件
> 将 守卫置空(什么都不写,只放一个next) 然后打正式包看看是否能正常进入页面 ``` import {RouterMount,createRouter} from 'uni-simple-router'; import Vue from 'vue'; const router = createRouter({ platform: process.env.VUE_APP_PLATFORM, routes: [...ROUTES], // beforeProxyHooks: { // onLoad(options: any, next: any){ //...
 会不会和这个参数有关系?
> 除去 `onLaunch` 试试 , currentRoute 这个属性是运行时 除去onlaunch 只留下onLoad是可以正常打开的
> ### 你可以这样写试试,但是我用github上的测试demo打包未出现这个BUG > ```js > onLaunch([options]: any, next: any){ > next([{ > ...options||{} > }]) > } > ``` > > ### 这是打包后的demo > [__UNI__DB9F679_1224193430.zip](https://github.com/SilurianYang/uni-simple-router/files/7774187/__UNI__DB9F679_1224193430.zip) 按照这种写法打包出来依旧是白屏的
> 请提供可复现的demo 抱歉,在已有项目中集成的,无法提供可复现的demo, 感谢作者的解答
> ### 给大家避避坑, 一开始用`react-native-wechat`后来转`lib`的是有可能会出现这个问题的,因为RN原生模块里link的可能还是上一个库的内容, 是需要将之前的wechat删除重新link `lib`的,具体可以通过打印Wechat看看里面的对象方法是否还是上一个库的内容就知道了