UNPKG

lc-vue-grid-layout-wrapper

Version:
2 lines (1 loc) 1.99 kB
import{d as m,G as a,D as r,a2 as f,a3 as C,h,o as v,c as _,B as e,O as A,b as g,a as b}from"./chunks/framework.a47393eb.js";function i(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!f(o)}const E=m({props:{col:{type:Number,default:2}},render(){if(this.$slots.default){const o=this.$slots.default().filter(l=>typeof l.type!="symbol");console.log("vNodes",o);const s=[];for(let l=0;l<Math.ceil(o.length/this.col);l++)for(let n=0;n<this.col;n++){const p=l*this.col+n;o[p]&&(s[l]=s[l]||[],s[l][n]=o[p])}return console.log(s),s.map(l=>{let n;return a(r("el-row"),{gutter:24},i(n=l.map(p=>a(r("el-col"),{span:24/this.col},i(p)?p:{default:()=>[p]})))?n:{default:()=>[n]})})}return a("div",null,null)}}),V=A("",7),q=A("",4),P=JSON.parse('{"title":"lc-vue-grid-layout-wrapper","description":"","frontmatter":{},"headers":[],"relativePath":"index.md"}'),x={name:"index.md"},S=Object.assign(x,{setup(o){const s=C({value1:"",value2:"",value3:""}),l=C({value1:[{required:!0,message:"请输入value1"}]}),n=h(),p=async()=>{try{await n.value.validate()}catch(y){console.log(y)}};return(y,t)=>{const F=r("el-input"),D=r("el-form-item"),u=r("el-button"),d=r("el-form");return v(),_("div",null,[V,a(d,{ref_key:"formRef",ref:n,model:s,rules:l,"label-position":"top"},{default:e(()=>[a(g(E),{col:2},{default:e(()=>[a(D,{label:"测试1",prop:"value1"},{default:e(()=>[a(F,{modelValue:s.value1,"onUpdate:modelValue":t[0]||(t[0]=c=>s.value1=c)},null,8,["modelValue"])]),_:1}),a(D,{label:"测试2",prop:"value2"},{default:e(()=>[a(F,{modelValue:s.value2,"onUpdate:modelValue":t[1]||(t[1]=c=>s.value2=c)},null,8,["modelValue"])]),_:1}),a(D,{label:"测试3",prop:"value3"},{default:e(()=>[a(F,{modelValue:s.value3,"onUpdate:modelValue":t[2]||(t[2]=c=>s.value3=c)},null,8,["modelValue"])]),_:1})]),_:1}),a(D,{label:"测试3"},{default:e(()=>[a(u,{onClick:p},{default:e(()=>[b("确认")]),_:1})]),_:1})]),_:1},8,["model","rules"]),q])}}});export{P as __pageData,S as default};