有个需求是,左侧导航栏,当页面宽度小于某个值时收缩起来函数
// 在mounted钩子函数中根据宽度设置 mounted() { if (document.body.clientWidth < 1500) { this.collapseChage(); } }