![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
々仄言
这个作者很懒,什么都没留下…
展开
-
keep-alive vue组件缓存
1、利用include、exclude属性 include定义缓存白名单,keep-alive会缓存命中的组件;exclude定义缓存黑名单,被命中的组件将不会被缓存;max定义缓存组件上限,超出上限使用LRU的策略置换缓存数据。 <keep-alive :include="whiteList" :exclude="blackList" :max="amount"> <router-view></router-view> </keep-alive>原创 2020-10-26 09:34:52 · 197 阅读 · 0 评论 -
vue @click 绑定的函数,传入事件对象和自定义参数
1.仅传入自定义参数 html: <div id="app"> <button @click="tm(123)">ddddd</button> </div> js: new Vue({ el:'#app', methods:{ tm:function(e){ console.log(e); //会输出 123 } } }) 2.仅传入事件对象 html: <div id="app原创 2020-10-13 14:46:19 · 2072 阅读 · 0 评论 -
创建vue3.0项目
1.vue create + 项目名 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.是否保存项目模板原创 2020-09-14 09:21:10 · 233 阅读 · 0 评论 -
vue 中导航重复点击报错冗余导航
报错信息如图 解决方法 方法1:在导航点击事件中加入catch方法 jumprouting(e){ this.$router.push(e.path).catch(err => err) } 方法2 : 在router.js 文件中添加如下代码 Vue.use(VueRouter); const originalPush = VueRouter.prototype.push VueRouter.prototype.push = function push(原创 2020-09-10 11:50:49 · 1026 阅读 · 0 评论 -
设置浏览器版本不兼容提示
在public中的index.html文件中设置 如图: 设置代码: <!--[if lte IE 9]>您的浏览器版本过低 请下载最新的谷歌浏览器<![endif]--> 显示内容居中样式代码: 下载最新谷歌浏览器链接: <!--[if lte IE 9]> <div style='position:absolute; top: 50%; left:50%; margin-top: -50px;margin-left: -400px; align-i原创 2020-08-31 11:17:59 · 813 阅读 · 0 评论