gogocode-plugin-element

0.0.3 • Public • Published

Element to Element Plus 升级插件

开始迁移

Element Plus 稳定版已经正式发布,在使用上与 Element 存在一定的差异。我们根据Element Plus Breaking Changes利用gogocode这个代码转换利器,开发了Element to Element Plus升级插件。这个插件能够快速地把你的 Element 代码升级到 Element Plus。

首先需要确认的是,你的项目是否已经从 Vue2 升级为 Vue3,如果还没有,建议尝试使用Vue2 to Vue3 升级插件来协助你

然后就可以开始进行 对 Element 引用的升级

你也可以参考我们针对 vue-element-admin 项目升级的实战教程:升级 Vue3 的最后一块拼图,快试试这个工具自动升级你的 Element 老项目

安装工具

全局安装最新的 gogocode-cli

npm install gogocode-cli -g

一键升级 Element 的引用代码

执行如下命令:​

注意:-s 后面是原文件的目录/文件名,-o 后面是输出的目录/文件名,如果两者相同,转换插件会覆盖你的代码,在此操作前请做好备份。

gogocode -s ./src -t gogocode-plugin-element -o ./src-out

转换操作执行完毕后新的引用 Element Plus 的代码会被写入到 src-out 目录中。

另外,由于是静态的代码转换,可能你的代码里会有些我们没想到的写法导致转换出乱子,转换后请做好人工比对和测试!发现转换的问题可以提交给我们。

指定应用规则

添加参数 -p include-rules=xxx,yyy,举例只应用 calendarpopover 规则:

gogocode -s ./src -t gogocode-plugin-element -o ./src-out -p include-rules=calendar,popover

规则名称请参看 rules.js 里面的 name 字段。

排除应用规则

添加参数 -p exclude-rules=xxx,yyy,举例只排除 calendarpopover 规则:

gogocode -s ./src -t gogocode-plugin-element -o ./src-out -p exclude-rules=calendar,popover

规则名称请参看 rules.js 里面的 name 字段。

联系我们

如果你在使用过程中遇到其他问题可以通过如下方式联系我们:

github: https://github.com/thx/gogocode/issues

钉钉群:34266233

gogocode 转换问题可以分享https://play.gogocode.io/相关链接给我们

相关文档

Element Plus Breaking Changes

Readme

Keywords

Package Sidebar

Install

npm i gogocode-plugin-element

Weekly Downloads

31

Version

0.0.3

License

ISC

Unpacked Size

27.3 kB

Total Files

16

Last publish

Collaborators

  • fyhere