Comments (12)
以.md结尾的文件即可,包括标题及正文。请发布到我的邮箱📬 我会在文档首页上说明出处。感谢你的支持!
from uni-simple-router.
这个问题 其实可以这样解决 在H5上 使用通配符 *
然后获取到 to 对象 接着你判断下当前是否在微信浏览器打开 如果是 你可以把 to 对象的 name 和query 组装成一个对象 最好转成字符串传递 作为到此个页面的参数 然后 重新 return 出去。 这样 在这个页面后面就保留了相关信息。 完事之后在beforeEach 中判断当前 to是否带了参数 如果有预设的微信浏览器的标识 那么就拿到 query后面的参数重新 next() 一下 这样就能完成了
from uni-simple-router.
@SilurianYang 文字描述清楚达义太难了:-) 然额通配符*分支,在其他页面都精确配置路由的情况下,由于不占优先级,*分支走不到吧?求出手更准确的代码:-)
from uni-simple-router.
@minkuan 那你可以把通配符的代码移植到 beforeEach
中一样可以使用 反应就是想办法 在路径过来拼接上当前页面的所有信息
from uni-simple-router.
@minkuan 你可以加群讨论或者完善 uni-simple-router 群号:769241495
from uni-simple-router.
router.beforeEach((to, from, next) => {
// #ifdef H5
console.log("beforeEach..to=", to, "..from=", from, "..to.query.wxRefreshed=", to.query.wxRefreshed, "..isWx=", Consts.isWeixin());
// #endif
// #ifdef H5
uni.getSystemInfo({
success: function(res) {
console.log("successFunc..res=", res);
if (res.platform === "ios") {
console.log('ios====platform======')
if (to.name !== "home" && Consts.isWeixin()) {
// 是否有微信标识url参数?
if (!Consts.intOrStringEqual(to.query.wxRefreshed, "2")) { // 没有微信url标识
let newQuery;
if (to.query.wxRefreshed===undefined) newQuery = Object.assign(to.query, {wxRefreshed: 1});
else {
newQuery = Object.assign(to.query, {wxRefreshed: parseInt(to.query.wxRefreshed)+1})
}
next({
path: to.path,
query: newQuery
});
} else {
console.log('wxRefreshed=2')
next();
}
} else next()
}
},
complete: function() {
console.log("getSystemInfo..complete");
}
});
// #endif
// #ifndef H5
next();
// #endif
});
@SilurianYang 因H5在微信中手工刷新2次后即可复制链接/在浏览器中打开成功,以上代码尝试做2次路由。以上处理为嘛无效呢?此前在目标页mounted中尝试window.location.replace(xxx)则uni-simple-router将陷入无限刷新
from uni-simple-router.
卧槽,搞定~
from uni-simple-router.
卧槽,搞定~
哦!伙计 看起来你成功啦! 恭喜你 ! 我很希望你能贡献你的源码 放置文档 相关教程
下帮助更多人
from uni-simple-router.
卧槽,搞定~
哦!伙计 看起来你成功啦! 恭喜你 ! 我很希望你能贡献你的源码 放置文档
相关教程
下帮助更多人
没问题,你这项目及文档做的还不错。你说下格式要求,分享互助更多人
from uni-simple-router.
以.md结尾的文件即可,包括标题及正文。请发布到我的邮箱 我会在文档首页上说明出处。感谢你的支持!
简单记个文档,没看到你邮箱。。btw 留下你邮箱地址吧,我发你邮箱
from uni-simple-router.
以.md结尾的文件即可,包括标题及正文。请发布到我的邮箱 我会在文档首页上说明出处。感谢你的支持!
简单记个文档,没看到你邮箱。。btw 留下你邮箱地址吧,我发你邮箱
遇到同样的问题,微信刷新死循环。您能发一份完整的文档吗? 我在官方文档教程没找到,非常感谢!
from uni-simple-router.
@jpgaus 这是楼主提供的解决方案 我上传上来 希望帮助更多需要的人
uni-simple-router解决IOS微信浏览器URL-BUG.docx
from uni-simple-router.
Related Issues (20)
- 完全使用vue-router开发模式下,组件内调用uni.createSelectorQuery()方法报错 HOT 2
- Vue3+Vite支持 HOT 4
- h5项目,路由模式为history,页面跳转正常,但地址栏不再有任何变化,并且控制台报了一个错误 HOT 5
- 网站无法访问 HOT 1
- url传参“/?a=value&b=value2”如果以“&”结尾,路由报错 HOT 1
- web-view不能跳转 HOT 1
- 小程序点击回到首页按钮不触发beforeEach守卫 HOT 1
- 能支持vue3 吗 HOT 4
- 关于支持 vue3 及 vite 的可用版本 HOT 6
- vue3
- H5没有上级页面时,点击导航栏的返回,返回拦截不起作用 HOT 1
- 快手小程序无法正常跳转 HOT 2
- 第三方H5回退会触发 uni-app afterEach HOT 2
- 使用自定义custom-tab-bar 路由监听不到 HOT 3
- h5配置aliasPath无法重定向路由 HOT 1
- uniapp 回退到上一个页面偶现当前页面无法释放 HOT 3
- app端在全局路由前置守卫使用uni.navigateTo不生效 HOT 1
- 循环调用 notRouteTo404 和 navjump HOT 1
- 使用路由守卫功能,点击返回,标题显示错误 HOT 2
- 希望支持快手小程序 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uni-simple-router.