vue 中解决提示警告 for循环报错

boy 火巨

警告

1.出现这个警告问题的时候 我们可以去main.js中在头部添加这句话:

Vue.config.productionTip = false
这样即可去除警告!


2.在build文件下的webpack.base.conf.js文件中,

将 ...(config.dev.useEslint ? [createLintingRule()] : []),注释掉,

这是对原来的写法进行了封装,你去看这个方法对应的代码就会发现里面的详细规则:

const createLintingRule = () => ({  

    test: /\.(js|vue)$/,  loader: 'eslint-loader',  enforce: 'pre',  include: [resolve('src'), resolve('test')],  

options: {    formatter: require('eslint-friendly-formatter'),    emitWarning: !config.dev.showEslintErrorsInOverlay  }})

这么处理之后,即可解决ESLint报警告的问题。


for循环报错
需要把vetur.validation.template这个参数改为false


vscode 编辑器 左上角的 文件--首选项---设置  然后右边的 用户设置
修改成 
"vetur.validation.template": false

猜你喜欢

转载自blog.csdn.net/qq_42221334/article/details/80336458
今日推荐