vue 命令行报错“Do not use ‘new’ for side effects“


开始学习vue.js 对别人的项目敲,一路报错

1.命令行报错“Do not use ‘new’ for side effects“

main.js 的代码是 【没有用ESLint检查运行是没有问题的,使用了ESLint就会报标题的错误】

new Vue({
  router,
  el: "#app",
  render: h => h(App)
})

解决方法

let vRouter = new Vue({
    router,
    el: '#app',
    render: h => h(App)
});
Vue.use({
    vRouter
});

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 ESLint 校验报错 Do not use 'new' for side effects(no-new) 解决vue项目eslint校验 Do not use 'new' for side effects 的两种方法 C# 调用命令行命令 net use VUE之命令行报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead 解决办法 vue报错:Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as