摘要: hash: <button id="myBtn">按钮</button> <script> // 监听hash的变化:手动去改路由、浏览器前进后退、点击事件更改hash window.onhashchange = (e) => { console.log('老url', e.oldURL) cons 阅读全文
posted @ 2021-08-12 21:19 吴小明- 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 动态组件component标签是vue的一个内置组件,通过动态地设置is属性,渲染出对应的组件 使用方法: 1、components/MyText.vue: <template> <div> 文本组件 </div> </template> components/MyImage.vue: <templ 阅读全文
posted @ 2021-08-12 20:20 吴小明- 阅读(678) 评论(0) 推荐(0) 编辑