[vuejs/vue-router]在微信浏览器中都可以打开,在华为、在oppor9s和华为系列机器打开空白页。

2024-05-08 289 views
3
版本

2.2.1

复制链接

http://znwx.hdme999.com/#/Home/information/stock_infos

重现步骤

vue-router是用2.0.0的,在微信内置的浏览器中都可以打开,在ios自带的浏览器中也可以打开,但是在华为系列和oppo系列的都打不开。浏览器中打开是空白页

预期是什么?

不再是空白页

到底发生了什么?

正常打开

回答

9

我们需要更多详细信息才能执行任何操作,例如用户代理(应包含所有相关信息)。您是说基本示例:http://jsfiddle.net/posva/9r6xhqbp/甚至不起作用?或者 html 文件中的相同内容?如果示例更复杂,我们需要实际的重现。此外,请确保您没有history在不支持模式的旧浏览器中使用模式。

5

const router = new VueRouter({ paths: [{ path: '/Home', component: require('../src/components/home/Home.vue'), // 子路由 Children: [ { path: '/ Home/information',组件:require('../src/components/information/information.vue'),名称:'information',重定向:'strategy_infos',children:[ { path: '/Home/information/stock_infos ', name: 'stock_infos', 组件: require('../src/components/information/children/stock_infos/stock_infos.vue') }, { path: '/Home/information/strategy_infos', name: 'strategy_infos' , 组件: require('../src/components/information/children/strategy_infos/strategy_infos.vue') }, { 路径: '/Home/information/fundLikes/:id', 名称: 'fundLikes', 组件: require ('../src/components/information/children/fundLikes/fundLikes.vue') }, ] }, { 路径: '/Home/my', 名称: '我的', 组件: require('../src /components/my/my.vue') } ] }, { 路径: '/addChannel', 名称: 'addChannel', 组件: require('../src/components/addChannel/addChannel.vue') }, { // 股市直播详细路径: '/stock_comments/:id', name: 'stock_comments', component: require('../src/components/stock_comments/stock_comments.vue') }, { // 策略详细路径: ' /strategy_detInfos/:id', name: 'strategy_detInfos', component: require('../src/components/strategy_detInfos/strategy_detInfos.vue') }, { // 类基金详细(多个) path: '/fundLikes_dets/ :id', name: 'fundLikes_dets', component: require('../src/components/fundLikes_dets/fundLikes_dets.vue') }, { // 我的订阅路径: '/my_subscribe', name: 'my_subscribe',组件: require('../src/components/my_subscribe/my_subscribe.vue') }, { // 关于我 路径: '/my_about', 名称: 'my_about', 组件: require('../src/components /my_about/my_about.vue') }, { // 默认路由 path: '*', redirect: '/Home/information/strategy_infos' }

], linkActiveClass: '活动' }); // 输出路由器 导出默认路由器;

这是我的路由配置,下面是hash模式。 http://znwx.hdme999.com/#/Home/information/stock_infos这是我的项目地址。可以在pc和微信浏览器和safari中打开。 @posva

3

你还是没有回答我的问题...另外,请注意,尽管我很想,我不会说中文

8

因为拉入了axios,它是基于es6 Promise,所以在Android 4.4下无法使用。我用这个修复了它。

babel-runtime/core-js/promise

7

@Zenser 使用babel-runtime/core-js/promise怎么实现的使用

5

@AutumnDeSea你好,我按照你博客的方法写的,华为自带浏览器还是白屏,babel-profill也安装了

7

对于 2019 年遇到此问题的任何人 - 添加“babel-polyfill”包并将其导入到 main.js 文件中。这应该可以解决问题。