store?.getters?.token
保存后变成这样了,怎么修改,可以在保存时候,链式调用不报错,也不影响其他地方格式化?
格式化用的是eslint
vscode setting.json 是这个样子的
{
// "eslint.autoFixOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
//保存自动格式化
"editor.formatOnSave": true
}
.eslintrc
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential'
// 关闭ESlint关键代码
// '@vue/standard'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
indent: ['off', 2],
'space-before-function-paren': 0,
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
// 关闭prettier
'prettier/prettier': 'off',
"vue/comment-directive": 'off' // 解决index.html 中红线
}
}
可能是老版vuter造成的,换成新版的官方的试一下