vue3用Ant Design Vue开发集成form表单组件

先看展示于用法

展示: 

使用方法

let formList = [
    {
        name: '头像上传',
        value: 'head',
        type: 'Cropper',
        height: '250px',
        UploadType: ['image/jpeg', 'image/png', 'image/gif'],
        ifmust: true
    },
    {
        name: '我的昵称',
        value: 'name',
        type: 'input',
        maxlength: 10,
        placeholder: '请输入昵称(10字以内)',
        ifmust: true
    },
    {
        name: '当前身份',
        value: 'identity',
        type: 'input',
        maxlength: 8,
        placeholder: '请输入性别(8字以内)',
        ifmust: true
    },
    {
        name: '签名',
        value: 'signature',
        type: 'textarea',
        placeholder: '请输入签名',
        ifmust: true
    },
    {
        name: '迷你名片背景',
        value: 'miniback',
        type: 'upload',
        UploadType: ['image/jpeg', 'image/png'],
        ifmust: true,
        formtips: '上传图片格式必须为jpg/png,比例8:5宽高比,1MB以内'
    },
    {
        name: '个人空间背景',
        value: 'databack',
        type: 'upload',
        UploadType: ['image/jpeg', 'image/png'],
        ifmust: true,
        formtips: '上传图片格式必须为jpg/png,比例6:4宽高比,1MB以内'
    },
    {
        name: '当前项目展示',
        value: 'ProjectDisplay',
        type: 'slot',
        ifmust: true
    }
]

组件使用部分

<!-- form组件 -->
            <FormModule
                v-if="open_edit"
                :slotData="slotData"
                :formList="formList"
                :formDefaultData="formDefaultData"
                @onSubmit="onSubmit"
                @onClose="onClose"
                :ifproject="false"
                :typeshow="'ifformview'"
            >
                <template #ProjectDisplay="{ formValue }">
                    ssss{{ formValue }}
                    <div class="tb_vlcong">
                        <div class="top flex_z mb20">
                            <span class="flex_c">展示中: </span>
                            <draggable
                                :list="state.group1"
                                class="flex_1 flex_z"
                                group="group1"
                                ghost-class="ghost"
                                chosen-class="chosenClass"
                                animation="300"
                                itemKey="id"
                                @start="onStart"
                                @end="onEnd(formValue)"
                            >
                                <template #item="{ element }">
                                    <div class="xz ml20 close mb10">
                                        {{ element.name }}
                                    </div>
                                </template>
                            </draggable>
                        </div>
                        <div class="bottom flex_z">
                            <span class="flex_c flex_s_0 mr20">未展示: </span>
                            <div class="overauto flex_1 flex_z">
                                <draggable
                                    :list="state.group2"
                                    class="flex_1 flex_z"
                                    group="group1"
                                    ghost-class="ghost"
                                    chosen-class="chosenClass"
                                    animation="300"
                                    itemKey="id"
                                    @end="onEnd(formValue)"
                                >
                                    <template #item="{ element }">
                                        <div
                                            class="xz flex_s_0 mr20 mb10"
                                            @click="XZswitch(element)"
                                        >
                                            {{ element.name }}
                                        </div>
                                    </template>
                                </draggable>
                            </div>
                        </div>
                    </div>
                </template>
            </FormModule>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值