![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Vue.js
「已注销」
这个作者很懒,什么都没留下…
展开
-
解决element导航栏刷新,选中效果消失
问题:当页面刷新后,之前导航栏选中效果消失解决思路使用Vue提供的计算属性和侦听器computed,关于computed与watch的使用场景,可参考 此文章。操作这里我们声明了一个计算属性 checkNav computed: { checkNav() { const path = this.$route.path.replace('/', '') return path || '/' } },:default-active 绑定自定义属原创 2021-06-18 18:33:22 · 1316 阅读 · 0 评论 -
为网站增加喜庆灯笼特效
先预览一下效果:Vue:<template> <div> <div class="deng-box2"> <div class="deng"> <div class="xian" /> <div class="deng-a"> <div class="deng-b"> <div class="deng-t">原创 2021-03-31 01:29:08 · 499 阅读 · 0 评论 -
Vue启动报错:TypeError: compilation.templatesPlugin is not a function
项目升级启动报错:TypeError: compilation.templatesPlugin is not a function原因是版本不兼容删除 node_modules重新安装npm install --registry=https://registry.npm.taobao.org原创 2020-12-26 17:46:08 · 5131 阅读 · 0 评论 -
解决Vue页面跳转后,位置不在顶部
背景Vue页面路由跳转后,页面的位置是和上个页面位置一致的,没有自动定位到顶部。解决我是使用Vue CLI3,所以在main.js中定义scrollBehavior即可解决:const router = new VueRouter({ // history模式,去除URL中# mode: 'history', routes, // 解决路由跳转后,不显示在首...原创 2020-04-10 10:51:14 · 5581 阅读 · 1 评论