码迷,mamicode.com
首页 > 其他好文 > 详细

Do not use ‘new’ for side effects

时间:2018-06-09 14:40:43      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:disable   注释   java   cts   IV   bsp   isa   报错   new   

new Vue({
  el: ‘#App‘,
  router,
  template: ‘<App/>‘,
  components: { App }
})

  

上面这样会报错

改成下面这样就好了

 

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

Vue.use({vm})

 

或者加一行注释

/* eslint-disable no-new */
new Vue({
  el: ‘#App‘,
  router,
  template: ‘<App/>‘,
  components: { App }
})

  

 

Do not use ‘new’ for side effects

标签:disable   注释   java   cts   IV   bsp   isa   报错   new   

原文地址:https://www.cnblogs.com/tabCtrlShift/p/9159213.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!