代码保存,数据大屏嵌入页面中,隐藏菜单
mounted() {
window.document.addEventListener('mousemove', this._resizeHandler)
},
methods: {
_resizeHandler: debounce((val) => {
console.log(val.clientX);
if (val.clientX < 200) {
if (_this.$store.getters.device == 'desktop') return
_this.$store.dispatch('app/toggleDevice', 'desktop')
_this.$store.dispatch('app/toggleSideBar')
} else {
if (_this.$store.getters.device == 'mobile') return
_this.$store.dispatch('app/closeSideBar', { withoutAnimation: true })
_this.$store.dispatch('app/toggleDevice', 'mobile')
}
}, 50),