Vue3项目中,jsx配置不生效问题

vue3,按照jsx官网进行一系列配置后出现:

This experimental syntax requires enabling one of the following parser plugin(s): "jsx", "flow", "typescript"。

解决方法:

 在script中加入 lang="jsx", 如果是tsx,则改成 lang="tsx"

官方网址:@vue/babel-plugin-jsx

在vue3最新版本中,已作为预设项,也就是babel.config.js中jsx的plugins选项可写可不写 

猜你喜欢

转载自blog.csdn.net/m0_60820509/article/details/132236114