1111 <el-slider
1212 v-model =" formProps.labelWidth"
1313 style =" width : 70px ; margin-right : 6px ;"
14- size =" mini "
14+ size =" small "
1515 :format-tooltip =" sliderFormat"
1616 ></el-slider >
1717 </template >
2323 :min =" 3"
2424 :max =" 15"
2525 style =" width : 70px ; margin-right : 6px ;"
26- size =" mini "
26+ size =" small "
2727 ></el-slider >
2828 <span style =" font-size : 13px ;" >wrapperCol:</span >
2929 <el-slider
3030 v-model =" formProps.wrapperColSpan"
3131 :min =" 5"
3232 :max =" 24"
3333 style =" width : 70px ; margin-right : 6px ;"
34- size =" mini "
34+ size =" small "
3535 ></el-slider >
3636 </template >
3737
3838 <el-checkbox
3939 v-model =" formProps.inline"
4040 style =" margin-right : 6px ;"
41- size =" mini "
41+ size =" small "
4242 >
4343 Inline
4444 </el-checkbox >
4545 <el-checkbox
4646 v-model =" formFooter.show"
4747 style =" margin-right : 6px ;"
48- size =" mini "
48+ size =" small "
4949 >
5050 底部
5151 </el-checkbox >
178178 <el-select
179179 v-model =" curVueForm"
180180 placeholder =" ui"
181- size =" mini "
181+ size =" small "
182182 style =" margin-left : 10px ;width : 130px ;"
183183 @change =" handleUiChange"
184184 >
@@ -252,6 +252,31 @@ const VueAntForm = defineAsyncComponent(async () => {
252252 };
253253});
254254
255+ let installedNaive = false ;
256+ const VueNaiveForm = defineAsyncComponent (async () => {
257+ // eslint-disable-next-line no-unused-vars
258+ const [naive , antForm ] = await Promise .all ([
259+ import (' demo-common/components/Naive/index.js' ),
260+ import (' @lljj/vue3-form-naive' )
261+ ]);
262+
263+ return {
264+ name: ' naiveFormWrap' ,
265+ setup (props , { attrs, slots }) {
266+ // hack 动态install naive,因为我不知其它地方如何获取 vue app
267+ if (! installedNaive) {
268+ const instance = getCurrentInstance ();
269+ instance .appContext .app .use (naive .default );
270+ installedNaive = true ;
271+ }
272+
273+ return () => h (antForm .default , {
274+ ... attrs
275+ }, slots);
276+ }
277+ };
278+ });
279+
255280const typeItems = Object .keys (schemaTypes);
256281
257282export default {
@@ -260,6 +285,7 @@ export default {
260285 CodeEditor,
261286 VueElementForm,
262287 VueAntForm,
288+ VueNaiveForm,
263289 EditorHeader
264290 },
265291 data () {
@@ -271,8 +297,11 @@ export default {
271297 name: ' ElementPlus' ,
272298 component: ' VueElementForm'
273299 }, {
274- name: ' antdv ' ,
300+ name: ' Antdv ' ,
275301 component: ' VueAntForm'
302+ }, {
303+ name: ' Naive' ,
304+ component: ' VueNaiveForm'
276305 }],
277306 customFormats: {
278307 price (value ) {
@@ -286,7 +315,7 @@ export default {
286315 return this .$route .query .type ;
287316 },
288317 isUseLabelWidth () {
289- return this .curVueForm === ' VueElementForm ' ;
318+ return this .curVueForm !== ' VueAntForm ' ;
290319 },
291320 trueFormProps () {
292321 if (! this .formProps ) return {};
@@ -311,16 +340,16 @@ export default {
311340 };
312341 },
313342 trueFormFooter () {
314- const {
315- labelColSpan ,
316- wrapperColSpan
317- } = this .formProps ;
343+ // const {
344+ // labelColSpan,
345+ // wrapperColSpan
346+ // } = this.formProps;
318347
319348 return this .isUseLabelWidth ? (this .formFooter || {}) : {
320349 formItemAttrs: {
321350 wrapperCol: {
322- span: wrapperColSpan ,
323- offset: labelColSpan
351+ span: 24 ,
352+ offset: 0
324353 }
325354 }
326355 };
@@ -407,7 +436,7 @@ export default {
407436 labelPosition: ' top' ,
408437 inlineFooter: false ,
409438 labelColSpan: 10 ,
410- wrapperColSpan: 12 ,
439+ wrapperColSpan: 24 ,
411440 layoutColumn: 1
412441 },
413442 };
0 commit comments