react 转换成vue

问题遇到的现象和发生背景

react-to-vue具体是怎样进行使用的呢
我已经npm install react-to-vue -g 过了
但是Usage: rtv [options] file(react component)
Options:

-V, --version output the version number
-o --output [string] the output file name
-t --ts it is a typescript component
-f --flow it is a component with Flow type annotations
-h, --help output usage information
这一块是完全看不明白的 不知道如何进行使用

运行 rtv 你要转换的文件地址

我试了一下 确实能转换 。至于 options 就是一些配置 比如 -V 就是 vue版本 -o就是 输出的 路径

img

根据 girhub上这个 issues 就能看出 格式

img

https://github.com/vicwang163/react-to-vue/issues/10

也就是 rtv -Vxxx -o xxx 你要转换的react组件地址

这个 作者也说了只能转换最基础的 react组件 。你要是 用了 react路由 。redux、react的ui库(例如“antd)都是无法转换的 。有些鸡肋的。如果是简单的组件倒是可以用一下

我刚才试了一下 这个是我写的简单 记录
https://blog.csdn.net/weixin_44058725/article/details/126364034

这篇文章:React和Vue比较 也许能够解决你的问题,你可以看下