You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
863 B
Vue
35 lines
863 B
Vue
<template>
|
|
<div id="app">
|
|
<router-view />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { debounce } from '@/utils/index'
|
|
export default {
|
|
name: 'App',
|
|
mounted() {
|
|
if (this._isMobile()) {
|
|
// alert('请前往电脑端登录!')
|
|
this.$router.replace('/to-pc')
|
|
}
|
|
// 解决界面报错 ResizeObserver 问题
|
|
const _ResizeObserver = window.ResizeObserver
|
|
window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
|
|
constructor(callback) {
|
|
callback = debounce(callback, 16)
|
|
super(callback)
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
_isMobile() {
|
|
const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
|
|
return flag
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style lang="scss">
|
|
</style>
|