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刪除。



猜您在找 vue報錯:Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as