12 2020 档案

摘要:在说vue路由钩子函数之前,我先介绍一下路由的两种模式: const router = new VueRouter({ mode: 'history', mode: 'hash', }) 1.hash模式 hash模式背后的原理是onhashchange事件,可以用window.onhashchan 阅读全文
posted @ 2020-12-30 15:21 ZJTL 阅读(1382) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/9c95db596df5 阅读全文
posted @ 2020-12-29 21:46 ZJTL 阅读(66) 评论(0) 推荐(0) 编辑
摘要:在created钩子的时候处理 created(){ var enterEvent = this document.onkeydowm = function(e){ var key = window.event.keyCode if(key 13){ enterEvent.handle() } } 阅读全文
posted @ 2020-12-29 19:07 ZJTL 阅读(105) 评论(0) 推荐(0) 编辑
摘要:一、typeof console.log(typeof 1); // number console.log(typeof true); // boolean console.log(typeof 'mc'); // string console.log(typeof function(){}); / 阅读全文
posted @ 2020-12-27 21:35 ZJTL 阅读(305) 评论(0) 推荐(0) 编辑
摘要:获取所有的DOM节点 document.querySelectorAll('*') NodeList集合转化为数组 [...document.querySelectorAll('*')] 获取数组每个元素的标签名 [...document.querySelectorAll('*')].map(ele 阅读全文
posted @ 2020-12-27 21:19 ZJTL 阅读(103) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示