1.0.19 • Published 3 years ago
fusion-to-antd v1.0.19
fusion-to-antd 工具包使用说明
命令
plugin
npx fusion-to-antd plugin
当前目录为ice+fusion脚手架时,fusion-to-antd 会为当前项目添加antd依赖及相关插件,并自动补全antd全局样式配置。
此命令适合基于ice.js的组件迁移。
如果该工程为ice-script,请手动添加antd依赖及相关插件,步骤如下:
1. tnpm i antd @ant-design/icons ice-plugin-antd --save-dev
2. 在ice.config.js中找到属性plugin,新增
['ice-plugin-antd', {
themeConfig: {
"primary-color": "#5050E6",
"border-radius-base": "4px",
"font-size-base": "12px",
"text-color": "#333",
"text-color-secondary": "#999",
},
}],
replace
npx fusion-to-antd replace
当前项目目录使用的是fusion时,fusion-to-antd 会做以下事情
- 检索当前项目路径下所有的ts,js,tsx,jsx文件,不包含node_module、.umi、.ice目录。
- 将文件内包含fusion组件的引入替换为antd组件引入,包含fusion物料。
- 将文件内含有fusion组件(含fusion物料)进行antd(版本4.9.1)替换,替换顺序如下: 1. 替换 fusion及物料包引用 -> antd引用 2. 过滤 fusion组件不被antd支持的api 3. 替换 fusion组件api -> antd组件相关api 4. 补全 基于步骤2补全antd关联的属性和键值(通常在fusion某个api对应antd多个api时触发) 5. 销毁 原有fusion组件api(只销毁已完全被antd支持的api,保留尚未完全被支持的api)。
- 返回替换结果,差异及冲突输出在当前目录下的fta.log日志中。
你也可以指定路径深度,可以深度到指定某个文件,如
npx fusion-to-antd replace src/components
或
npx fusion-to-antd replace src/components/layout/layout.ts
fusion-to-antd
支持替换的组件列表
- affix
- avatar
- badge
- breadcrumb
- button
- calendar
- card
- cascader
- checkbox
- collapse
datepicker- divider
- drawer
dropdown- form
- grid
- input
- list
menu- message
- modal
notificationinputnumberpagination- progress
- popover
- radio
- row
- rate
slider- steps
- switch
- Select
- spin
- tooltip
- typography
- tabs
table- tag
timepicker- timeline
transfertreeupload
其它
1.0.19
3 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.16
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.9
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago