在开发者工具中 打印this.router 是 undefined
在真机中 this.router 出现了 路由方法集合 (如下图)
微信小程序页面this中莫名出现router方法 ,导致自己封装的router方法失效 ?The router method appears inexplicably on the WeChat applet page this, causing the router method to be encapsulated to fail?
微信小程序页面this中莫名出现router方法 ,导致自己封装的router方法失效 ?在开发者工具中 打印this.router 是 undefined
在真机中 this.router 出现了 路由方法集合 (如下图)
Print in developer tools this.router It's undefined in the real machine this.router The routing method set appears (as shown in the figure below)
回答:
比较恶心这个问题,好歹是个大厂,这种隐藏更新也不说下,今天我们也是碰到这个问题,劫持了page函数自己写入了router后,初始进入hub页面router是官方的,结果失效了,解决方法就是把自己命名的router名字改下,尽量加上自定义的标识。关键这个问题只在真机上出现,开发工具是正常的。
坑啊,开发环境没有,真机才有,查半天
建议自己封装的带 $ 字符,避免与官方方法冲突。
碰到一样的问题了,真的是坑啊,也不通知一下