data() {
return {
isPC: false
};
},
created() {
this.getScreen();
},
methods: {
getScreen() { if(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i )
) {
this.isPC= true;
console.log("手机端");
//修改src/router/index.js,在这里增加自己的要跳转的页面
} else {
this.isPC= false;
console.log("pc端");
}
}
12-28
4135
12-03
989
07-25
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交