vueのnpm run serve報錯Parsing error: The keyword 'import' is reserved

需要配置 eslint,在項目目錄下建立 .eslintrc.js 的方式來配置。

module.exports = {
    root: true,
    parserOptions: {
        sourceType: 'module'
    },
    // required to lint *.vue files
    plugins: [
        'html'
    ],
    // add your custom rules here
    'rules': {
        // allow debugger during development
        'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
    }
}

配置完重新啓動即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章