vue-router移动端不兼容
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="vue/vue.js" type="text/javascript" charset="utf-8"></script>
<script src="vue/vue-router.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<script type="text/javascript">
const Foo = { template: '
<router-link to="/user/foo">/user/foo</router-link> <router-link to="/user/bar">/user/bar</router-link>
<router-view></router-view>foo
' }
const Bar = { template: 'bar
' }
const home = {template:'home
'}
const router = new VueRouter({
routes: [
{path:'/',component:home},
{ path: '/user/bar', component: Bar },
{path:'/user/foo',component:Foo}
]
})
const app = new Vue({ router }).$mount('#app')
</script>
</body>
</html>
一个简单的demo,在移动端用浏览器访问,有些浏览器可以访问,有些浏览器不行,比如qq浏览器和uc浏览器就不行,我用手机自带的浏览器就可以,用微信也可以,不知道是什么原因,求各位大神相助