Comments (17)
具体要用哪个版本呀
vue2.7中直接用最新版即可。
但如果在babel中使用了@vue/cli-plugin-babel/preset
且@vue/cli-plugin-babel
版本低于小于5.0.8的话则需要将@vue/cli-plugin-babel/preset
配置中的jsx选项关闭
from jsx-vue2.
具体要用哪个版本呀
vue2.7中直接用最新版即可。 但如果在babel中使用了
@vue/cli-plugin-babel/preset
且@vue/cli-plugin-babel
版本低于小于5.0.8的话则需要将@vue/cli-plugin-babel/preset
配置中的jsx选项关闭
绝了,确实是这样,然后我们工作环境在pnpm的monorepo中,即便更新@vue/cli-plugin-babel
插件到5.0.8版本可能
也会有些奇怪的问题,索性像你这样,自己安装@vue/babel-preset-jsx
到1.3.1然后手动配置compositionAPI。谢了老哥。
from jsx-vue2.
@1446445040 我这是 vite 开发, cli 打包。明天我再试试吧。
并没有解决啊"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "@vue/babel-preset-jsx": "^1.3.1", "@vitejs/plugin-vue2": "^1.1.2", "@vue/cli-plugin-babel": "^5.0.8", presets: [ ['@vue/cli-plugin-babel/preset', { jsx: false }], ['@vue/babel-preset-jsx', { compositionAPI: true }] ],
我们的问题不一样,你这个是另外的问题了,话说你都用vite了,还用啥babel,直接用@vitejs/plugin-vue2-jsx就可以了哇
from jsx-vue2.
from jsx-vue2.
能获取到ref 吗?
from jsx-vue2.
使用了jsx setup 中返回元素 使用ref获取 不到dom啥原因?
from jsx-vue2.
@vue/cli-plugin-babel版本问题
from jsx-vue2.
具体要用哪个版本呀
from jsx-vue2.
为啥关闭issue了?有同样问题
from jsx-vue2.
为啥关闭issue了?有同样问题
看我上面的回复
from jsx-vue2.
"vite": "^3.0.0"
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
"@vue/babel-preset-jsx": "^1.3.1",
"@vitejs/plugin-vue2": "^1.1.2",
"@vue/cli-plugin-babel": "^5.0.8",
presets: [
['@vue/cli-plugin-babel/preset', { jsx: false }],
['@vue/babel-preset-jsx', { compositionAPI: true }]
],
from jsx-vue2.
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "@vue/babel-preset-jsx": "^1.3.1", "@vitejs/plugin-vue2": "^1.1.2", "@vue/cli-plugin-babel": "^5.0.8", presets: [ ['@vue/cli-plugin-babel/preset', { jsx: false }], ['@vue/babel-preset-jsx', { compositionAPI: true }] ],
并没有解决啊
我们的问题不一样,你这个是另外的问题了,话说你都用vite了,还用啥babel,直接用@vitejs/plugin-vue2-jsx就可以了哇
from jsx-vue2.
@1446445040 我这是vite开发,cli打包。明天我再试吧。
并没有解决办法啊"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "@vue/babel-preset-jsx": "^1.3.1", "@vitejs/plugin-vue2": "^1.1.2", "@vue/cli-plugin-babel": "^5.0.8", presets: [ ['@vue/cli-plugin-babel/preset', { jsx: false }], ['@vue/babel-preset-jsx', { compositionAPI: true }] ],
我们的问题不一样,你这个是另外的问题了,说你都用vite了,还用啥babel,直接接用@vitejs/plugin-vue2-jsx就可以了哇
"vite": "^3.0.0" "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "@vue/babel-preset-jsx": "^1.3.1", "@vitejs/plugin-vue2": "^1.1.2", "@vue/cli-plugin-babel": "^5.0.8", presets: [ ['@vue/cli-plugin-babel/preset', { jsx: false }], ['@vue/babel-preset-jsx', { compositionAPI: true }] ],
并没有解决办法啊vite不是有专门解析jsx的插件@vitejs/plugin-vue-jsx
from jsx-vue2.
看一下这个能不能帮到你们:https://juejin.cn/post/7342420969875210291
from jsx-vue2.
Related Issues (20)
- Error in binding keyboard
- To give a ref to the JSX Element but I cannot get it by $refs. why?
- Include License File
- Vue 2.7 compatibility HOT 6
- 无法在vue2.7的中使用ref获取dom,以及组件实例。 HOT 4
- scoped css not working with compositionAPI enabled and functional component using render HOT 1
- 迁移composition-api过程中无法兼容method和setup的injectH
- 创建的jsx文件导入到另一jsx中,导出小写不提示,大写提示非jsx HOT 1
- jsx 无法监听鼠标移入移除事件
- 两个preset都使用“sugar-inject-h”这个插件导致duplicate declaration h HOT 1
- 我用 map return 一组 tag div, 每个 div 中再用 ref 标记一个组件,最后得到的是一个 object, 我希望的到的是数组 HOT 3
- web component slot not work
- i want to know that how to use v-slot instead slot directive in jsx-vue2 HOT 4
- v-model compile error on playgroud
- bug:显式import render函数时不应该将其转化为h() , 请在转换时判断是否在vue组件的上下文中,或者是否是vue格式文件
- Modifiers _capture doesn't work with el-col of ElementUi HOT 2
- Cannot parse a prop that starts with _
- 在 Rspack 中无法正常工作 HOT 1
- 在vue2.7.16中使用@vue/babel-sugar-functional-vue,无法转换functional组件
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsx-vue2.