オブジェクト使ってないってことなので、newだけして回避するか、あるいはなんか使ってあげればよい。
ERROR Failed to compile with 1 errors 20:49:45
error in ./src/main.js
✘ http://eslint.org/docs/rules/no-unused-vars 'app2' is assigned a value but never used
src/main.js:17:5
var app2 = new Vue({
^
✘ 1 problem (1 error, 0 warnings)
Errors:
1 http://eslint.org/docs/rules/no-unused-vars
@ multi ./build/dev-client ./src/main.js
コードはこんな
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
template: '<App/>',
components: { App }
})
var app2 = new Vue({
el: '#app2',
data: {
message: 'Hello Vue!'
}
})
// console.log(app2)
app2オブジェクトをなんでもいいので使ってあげると通った。
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
template: '<App/>',
components: { App }
})
var app2 = new Vue({
el: '#app2',
data: {
message: 'Hello Vue!'
}
})
console.log(app2)
newだけして回避してもいい。
new Vue({
router
}).$mount('#app')