行业知识
微信小程序(五十九)使用鉴权组件时原页面js自动加载解决方法(24/3/14)
2026-11-29 13:09:43
来源:互联网转载
���释很详细,直接上代码
上一篇
新增内容:
1.使用覆盖函数的方法阻止原页面的自动执行方法
2.使用判断实现只有当未登录时才进行方法覆盖
源码:
app.json
{ "pages": [ "pages/index/index", "pages/logs/logs" ], "window": { "navigationBarTextStyle": "black", "navigationBarTitleText": "Weixin", "navigationBarBackgroundColor": "#ffffff" }, "usingComponents": { "auth":"/Components/auth/auth" }, "componentFramework": "glass-easel", "sitemapLocation": "sitemap.json", "lazyCodeLoading": "requiredComponents"} auth组件
auth.wxml