vuejs / babel-plugin-jsx

JSX for Vue 3
https://vue-jsx-explorer.netlify.app
MIT License
1.7k stars 143 forks source link

[Question] how to make vue jsx ast return to jsx #705

Closed hnustwjj closed 1 month ago

hnustwjj commented 3 months ago

🧐 Problem Description

I want to make some changes to the vue jsx code through babel. I want to know whether the ast of vue jsx can be converted back to jsx. Or can you provide me with some ideas?

image

💻 Sample code

🚑 Other information

sxzz commented 1 month ago

Vue JSX syntax is standard JSX syntax. Therefore, you can use general toolchains.

For example, you can use @babel/parser and @babel/generator to parse the AST and generate code.