infra:code review 表单增强
This commit is contained in:
parent
5ca3358237
commit
d05c67ffaa
@ -14,13 +14,13 @@ export const useFormCreateDesigner = (designer: Ref) => {
|
||||
const uploadImgsRule = useUploadImgsRule()
|
||||
|
||||
onMounted(() => {
|
||||
// 移除自带的上传组件规则
|
||||
// 移除自带的上传组件规则,使用 uploadFileRule、uploadImgRule、uploadImgsRule 替代
|
||||
designer.value?.removeMenuItem('upload')
|
||||
const components = [uploadFileRule, uploadImgRule, uploadImgsRule]
|
||||
components.forEach((component) => {
|
||||
//插入组件规则
|
||||
// 插入组件规则
|
||||
designer.value?.addComponent(component)
|
||||
//插入拖拽按钮到`main`分类下
|
||||
// 插入拖拽按钮到 `main` 分类下
|
||||
designer.value?.appendMenuItem('main', {
|
||||
icon: component.icon,
|
||||
name: component.name,
|
||||
|
@ -51,6 +51,7 @@ const dialogTitle = ref('') // 弹窗的标题
|
||||
const formType = ref(-1) // 表单的类型:0 - 生成 JSON;1 - 生成 Options;2 - 生成组件
|
||||
const formData = ref('') // 表单数据
|
||||
useFormCreateDesigner(designer) // 表单设计器增强
|
||||
|
||||
/** 打开弹窗 */
|
||||
const openModel = (title: string) => {
|
||||
dialogVisible.value = true
|
||||
|
Loading…
Reference in New Issue
Block a user