Vue编写一个新的vue页面时,使用export default导出vue页面时,报错
<script>
export default{
name: 'Top'
}
</script>
出现的错误:
WARNING Compiled with 1 warnings 10:56:57 ├F10: AM┤
✘ http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4
src\components\Top.vue:12:1
name: 'Top'
^
✘ http://eslint.org/docs/rules/eol-last Newline required at end of file but not found
src\components\Top.vue:14:10
</script>
^
✘ 2 problems (2 errors, 0 warnings)
解决方法:
找到webpack.base.conf.js文件中...(config.dev.useEslint ? [createLintingRule()] : []),
module: {
rules: [
<!-- ...(config.dev.useEslint ? [createLintingRule()] : []), -->
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
然后关闭Vue,重新开启