ccbscf-ui-transfer
iview 升级 ccbscf-ui-plus 组件库转换器
vue2 升级 vue3 代码转换器
触发 vscode 命令
command + shift + ccbscf vue3 (1.将 iview 标签转换为 ccbscf-ui 标签;2.升级vue2 兼容 vue3 语法)
- 参考
vue2 迁移指南
iview 标签转换为ccbscf-ui-plus
command + shift + ccbscf ui (将 iview 标签转换为 ccbscf-ui 标签)
- 只对
iview 标签转换为ccbscf-ui-plus
参考 vue2 迁移指南
- 只将
vue-html 部分 iview 组件标签转换为ccbscf-ui-plus 组件标签
- 替换
v-on="$listeners" 属性为v-bind="$attrs"
- 替换
:value 为 :modelValue ,<Option></Option> 标签除外
- 删除
.native 语法
$emit("input",value) 替换为 $emit("update:value",value)
- 替换
iview 、view-design 为ccbscf-ui-plus
- 定义
emits:[]
- 替换
slot ,创建<template #slotName></template> 标签 进行兼容
<button slot="append">查询</button>
转换后
<template #append>
<c-button>查询</c-button>
</template>
- 不支持的属性给出提示,指导手动修改
// [Vue3 TODO] In 3.x, the $children property is removed. Instead, we recommend using template refs.
this.$children;
vue3
eventbus
// vue3 eventbus
import emitter from "tiny-emitter/instance";
export default {
$on: (...args) => emitter.on(...args),
$once: (...args) => emitter.once(...args),
$off: (...args) => emitter.off(...args),
$emit: (...args) => emitter.emit(...args),
};
| |