vue使用v-for时vscode报错 Elements in iteration expect to have 'v-bind:key' directives Vue 2.2.0+的版本里,当在组件中使用v-for时,key是必须的错误提示:[vue-language-server] Elements in iteration expect to have 'v-bind:key' directives.Renders the element or template block multipl…
参考解决在WebStorm中使用Vue的v-bind,v-on报错 File-->Settings-->Editor-->Inspections-->XML 把 Unbound XML namespace prefix的勾去掉 应用即可…
Vue Router 常见问题 用于记录工作遇到的Vue Router bug及常用方案 router.push报错,Avoided redundant navigation to current location: "/xxx" 大意为 路由频繁点击导致路由重复,该报错对路由跳转功能没有任何影响 解决方案:重写push方法 将异常捕获就不会报错了 let routerPush = VueRouter.prototype.push; VueRouter.prototype.push =…
1.安装node.js 参考教程:http://nodejs.cn/download/ 我的是windows 64位系统,以此为例: (1)打开 http://nodejs.cn/download/ ,下载安装包 (2)一直点击下一步,进行安装 (3)设置global和cache路径 在node.js 的安装目录下新建node_global 和node_cache文件夹 打开cmd 输入 npm config set prefix "D:\Program Files\nodejs\node_gl…
问题 /sockjs-node/info 无限报错 解决方案 原因是相关代理端不支持 ws,因此需要在代理处关闭 ws,即 ws: false,如下: vue.config.js const ds_proxy = { '/': { ws: false, target: 'https://dev.test.gitinn.com/', changeOrigin: true, }, }…
问题描述: vue项目中,想要更换.ico图片,更换完成后刷新页面报错,找不到路径. 解决: 更换完图片,重新启动下vue项目(npm run dev)就可以啦~ 哈哈哈 补充知识: 网页title旁边的小图片设置,图片要求格式必须是.ico,附加ico图片转换地址:http://www.bitbug.net 在html文件中的<head></head>标签中加上: <link rel="icon" href="picture.ico"…
在npm install的时候会报错,经过上网查阅资料之后,解决方法如下: 0.先升级npm版本:npm install -g npm   有可能是npm版本过低报错 1.然后清理缓存: npm cache clean --force  可能会有之前遗留代码会产生影响,所以先清理缓存 2.再执行 npm config set registry http://registry.cnpmjs.org 3.再执行 npm install 或者直接执行: 0.先升级npm版本:npm install -…
搭建了一个vue项目,在配置路有的时候,陆续出现了各种报错其中最多的是一些写法,例如空格,缩进,各种括号,结果我一句一句对照,修改相当之费时间,效率低,一上午,一个路由配置都没写好 主要报错如下: 截取了一段常见报错,选取其中一个: Expected indentation of 4 spaces but found 1 tab 翻译一下,意思是:预期缩进4个空格,但找到1个选项卡.意思是vue在检测写法规则的时候,只认空格,不认tab的缩进,这时你就要修改的页面内容,把tab换成空格,这样就比…
不出错的情况下,正常安装: 1.安装包: npm install node-sass --save-dev npm install sass-loader --save-dev (sass-loader依赖于node-sass) 2.在build文件夹下的webpack.base.conf.js的rules里面添加配置 { test: /\.sass$/, loaders: ['style', 'css', 'sass'] } 3.在APP.vue中修改style标签 <style lang=&qu…
楼主最新对已做项目进行打包优化,配置了打包环境下去除console.log语句插件---使用uglifyjs-webpack-plugin具体代码如下 npm install uglifyjs-webpack-plugin -D const UglifyJsPlugin = require('uglifyjs-webpack-plugin') configureWebpack: config => { if (isProduction) { config.plugins = config.plu…