perf[ResizeHandler]: optimized the judgment of isMobile (#1633)
perf[ResizeHandler]: optimized the judgment of isMobile
This commit is contained in:
parent
2d8a238880
commit
0f3d2bcd05
|
@ -1,8 +1,7 @@
|
|||
import store from '@/store'
|
||||
|
||||
const { body } = document
|
||||
const WIDTH = 1024
|
||||
const RATIO = 3
|
||||
const WIDTH = 992 // refer to Bootstrap's responsive design
|
||||
|
||||
export default {
|
||||
watch: {
|
||||
|
@ -25,7 +24,7 @@ export default {
|
|||
methods: {
|
||||
isMobile() {
|
||||
const rect = body.getBoundingClientRect()
|
||||
return rect.width - RATIO < WIDTH
|
||||
return rect.width - 1 < WIDTH
|
||||
},
|
||||
resizeHandler() {
|
||||
if (!document.hidden) {
|
||||
|
|
Loading…
Reference in New Issue