标签:headers post eol port ast warnings ror err 设置
eslint “eol-last”:0 文件末尾强制换行(就是代码结尾处,要来个空格,相当于加一行,设置为0就可以了)
./src/main.js
error eol-last Newline required at endoffile but notfound
/Users/xxx/site/xxx/src/main.js:24:2
router.start(require(‘./app.vue‘), ‘#app‘)
^
?1 problem (1error, 0warnings)
源码
import Vue from‘vue‘
import VueRouter from‘vue-router‘
import VueResource from‘vue-resource‘
// install router
Vue.use(VueRouter)
Vue.use(VueResource)
// 全局配置
Vue.config.debug = true
// 不加跨域xhr会发起options请求
Vue.http.options.headers = {
‘Content-Type‘: ‘application/x-www-form-urlencoded;charset = UTF-8;‘
}
// post的时候会把JSON对象转成formdata
Vue.http.options.emulateJSON = true
// create router
const router = new VueRouter()
router.map({
‘/‘: {
component: require(‘./components/home.vue‘)
}
})
router.start(require(‘./app.vue‘), ‘#app‘)
//这里一定要空一个行
标签:headers post eol port ast warnings ror err 设置
原文地址:http://www.cnblogs.com/zhaobao1830/p/6411785.html