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