GithubHelp home page GithubHelp logo

Comments (17)

wehuss avatar wehuss commented on May 28, 2024 1

具体要用哪个版本呀

vue2.7中直接用最新版即可。
但如果在babel中使用了@vue/cli-plugin-babel/preset@vue/cli-plugin-babel版本低于小于5.0.8的话则需要将@vue/cli-plugin-babel/preset配置中的jsx选项关闭
image

from jsx-vue2.

emosheeep avatar emosheeep commented on May 28, 2024 1

具体要用哪个版本呀

vue2.7中直接用最新版即可。 但如果在babel中使用了@vue/cli-plugin-babel/preset@vue/cli-plugin-babel版本低于小于5.0.8的话则需要将@vue/cli-plugin-babel/preset配置中的jsx选项关闭 image

绝了,确实是这样,然后我们工作环境在pnpm的monorepo中,即便更新@vue/cli-plugin-babel插件到5.0.8版本可能
也会有些奇怪的问题,索性像你这样,自己安装@vue/babel-preset-jsx到1.3.1然后手动配置compositionAPI。谢了老哥。
截屏2022-08-01 12 12 46

from jsx-vue2.

kunl avatar kunl commented on May 28, 2024 1

@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 }]
 ],
image 并没有解决啊

我们的问题不一样,你这个是另外的问题了,话说你都用vite了,还用啥babel,直接用@vitejs/plugin-vue2-jsx就可以了哇

from jsx-vue2.

wehuss avatar wehuss commented on May 28, 2024

暂时先这样解决了
image

from jsx-vue2.

jetBn avatar jetBn commented on May 28, 2024

能获取到ref 吗?

from jsx-vue2.

jetBn avatar jetBn commented on May 28, 2024

使用了jsx setup 中返回元素 使用ref获取 不到dom啥原因?

from jsx-vue2.

wehuss avatar wehuss commented on May 28, 2024

@vue/cli-plugin-babel版本问题

from jsx-vue2.

emosheeep avatar emosheeep commented on May 28, 2024

具体要用哪个版本呀

from jsx-vue2.

agileago avatar agileago commented on May 28, 2024

为啥关闭issue了?有同样问题

from jsx-vue2.

wehuss avatar wehuss commented on May 28, 2024

为啥关闭issue了?有同样问题

看我上面的回复

from jsx-vue2.

kunl avatar kunl commented on May 28, 2024
   "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 }]
 ],

image

并没有解决啊

from jsx-vue2.

emosheeep avatar emosheeep commented on May 28, 2024
 "@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 }]
 ],
image

并没有解决啊

我们的问题不一样,你这个是另外的问题了,话说你都用vite了,还用啥babel,直接用@vitejs/plugin-vue2-jsx就可以了哇

from jsx-vue2.

xiangtaot avatar xiangtaot commented on May 28, 2024

@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.

Dinert avatar Dinert commented on May 28, 2024

看一下这个能不能帮到你们:https://juejin.cn/post/7342420969875210291

from jsx-vue2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.