[vue/compiler-sfc] This experimental syntax requires enabling one of the following parser plugin(s): "jsx", "flow", "typescript".
时间: 2023-08-18 12:05:37 浏览: 496
vue-template-babel-compiler:为基于 Babel 的 Vue.js SFC 启用 Optional Chaining 和许多新的 ES 特性
To enable one of the required parser plugins for the Vue SFC compiler, you need to configure your project's build system or compiler options accordingly.
If you are using Babel, you can install the necessary plugin and configure it in your `.babelrc` or `babel.config.js` file. For example, to enable JSX syntax, you can install the `@babel/plugin-syntax-jsx` package and add it to your Babel configuration:
```json
{
"plugins": ["@babel/plugin-syntax-jsx"]
}
```
If you are using TypeScript, you can enable the plugin by updating your `tsconfig.json` file:
```json
{
"compilerOptions": {
"plugins": [
{ "name": "@typescript-eslint/parser", "project": "./tsconfig.json" }
]
}
}
```
Please note that the specific configuration details may vary depending on your build system or tooling setup. Make sure to consult the documentation for your specific setup to enable the required parser plugin successfully.
阅读全文