提交 7725f72b 编写于 作者: Pan's avatar Pan

perf[ResizeHandler]: optimized the judgment of isMobile

上级 a0b46fed
import store from '@/store' import store from '@/store'
const { body } = document const { body } = document
const WIDTH = 1024 const WIDTH = 992 // refer to Bootstrap's responsive design
const RATIO = 3
export default { export default {
watch: { watch: {
...@@ -25,7 +24,7 @@ export default { ...@@ -25,7 +24,7 @@ export default {
methods: { methods: {
isMobile() { isMobile() {
const rect = body.getBoundingClientRect() const rect = body.getBoundingClientRect()
return rect.width - RATIO < WIDTH return rect.width - 1 < WIDTH
}, },
resizeHandler() { resizeHandler() {
if (!document.hidden) { if (!document.hidden) {
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或