Syntax Error: Thread Loader (Worker 0) F:\inter\gongsi\src\layout\components\Sidebar\Item.vue: Support for the experimental syntax 'jsx' isn't currently enabled (20:19): 18 | 19 | if (icon) { > 20 | vnodes.push(<svg-icon icon-class={icon}/>) | ^ 21 | } 22 | 23 | if (title) {
如果是用的babel.config.js 配置文件,则
module.exports = { presets: [ '@vue/cli-plugin-babel/preset', [ '@babel/preset-env', { 'useBuiltIns': 'entry', 'corejs': 3 } ] ], plugins: [] }
如果是用的.babelrc 则可以
{ "presets": [ ["env", { "modules": false, "targets": { "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] } }], "stage-2" ], "plugins": ["transform-vue-jsx", "transform-runtime"], "env": { "test": { "presets": ["env", "stage-2"], "plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"] } } }