1 |
- import{i as m,B as b}from"./index-K8IR974I.js";import{d as f,x as s,j as t,K as i}from"./vue-A59npLRR.js";import{_ as y}from"./index-EwE51S_X.js";const p=f({name:"formItem",props:{label:{type:String},type:{type:String,required:!0,validator:e=>m.includes(e)},modelValue:{required:!0},inputAttr:{type:Object,default:()=>{}},attr:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}},prop:{type:String,default:""},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:r}){const o=a=>{r("update:modelValue",a)},l=s(()=>e.attr&&e.attr.blockHelp?e.attr.blockHelp:""),d=()=>{let a=t(b,{type:e.type,attr:{placeholder:e.placeholder,...e.inputAttr},data:e.data,modelValue:e.modelValue,"onUpdate:modelValue":o});return l.value?[a,t("div",{class:"block-help"},l.value)]:a},n=["string","password","number","textarea","datetime","year","date","time","select","selects","remoteSelect","remoteSelects","city","icon","color"],u=["radio","checkbox","switch","array","image","images","file","files","editor"];if(n.includes(e.type))return()=>t(i("el-form-item"),{prop:e.prop,...e.attr,label:e.label},{default:d});if(u.includes(e.type)){let a=e.data&&e.data.title?e.data.title:e.label;const c=()=>[t("div",{class:"ba-form-item-label"},[t("div",null,a),t("div",{class:"ba-form-item-label-tip"},e.data&&e.data.tip?e.data.tip:"")])];return()=>t(i("el-form-item"),{class:"ba-input-item-"+e.type,prop:e.prop,...e.attr,label:e.label},{label:c,default:d})}}}),g=y(p,[["__scopeId","data-v-fcc66b29"]]);export{g as F};
|