摘要: 使用location.href=’/url’来跳转,简单方便,但是刷新了页面;使用history.pushState(’/url’),无刷新页面,静态跳转; 引进router,然后使用router.push(’/url’)来跳转,使用了diff算法,实现了按需加载,减少了dom的消耗。其实使用rou 阅读全文
posted @ 2022-09-27 14:21 不爱学习的摆烂王 阅读(1741) 评论(0) 推荐(0)
摘要: 做谷粒学苑项目时,在保存登录状态环节出现该问题 取cookie时老师强调要使用JSON.pase()解析cookie为json对象 var userStr = cookie.get("guli_ucenter"); // 把字符串转换json对象(js对象) if (userStr) { this. 阅读全文
posted @ 2022-09-27 14:00 不爱学习的摆烂王 阅读(887) 评论(0) 推荐(0)