有個需求是,左側導航欄,當頁面寬度小於某個值時收縮起來函數
// 在mounted鉤子函數中根據寬度設置 mounted() { if (document.body.clientWidth < 1500) { this.collapseChage(); } }