parent
31732fdf1f
commit
f2e869d650
@ -0,0 +1,13 @@ |
||||
<script type="text/jsx"> |
||||
export default { |
||||
data: () => ({show: false}), |
||||
|
||||
render() { |
||||
return ( |
||||
<transition name="el-fade-in-linear"> |
||||
{this.show && <div class="aside-hidden-mask" on-click={this.onClick}/>} |
||||
</transition> |
||||
) |
||||
} |
||||
} |
||||
</script> |
||||
@ -1,25 +0,0 @@ |
||||
import {mutations as mainMutations} from "@/layout/store/main" |
||||
import {debounce} from '@/util' |
||||
import {isMobile} from "@/util/browser" |
||||
|
||||
export default { |
||||
methods: { |
||||
$_resizeHandler() { |
||||
if (!document.hidden) { |
||||
const mobile = isMobile() |
||||
mainMutations.device(mobile ? 'mobile' : 'pc') |
||||
mobile && this.collapseSidebar() |
||||
} |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.$_resizeHandler = debounce(this.$_resizeHandler) |
||||
this.$_resizeHandler() |
||||
|
||||
window.addEventListener('resize', this.$_resizeHandler) |
||||
|
||||
this.$once('hook:beforeDestroy', () => { |
||||
window.removeEventListener('resize', this.$_resizeHandler) |
||||
}) |
||||
} |
||||
} |
||||
Loading…
Reference in new issue