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