11
11
<el-slider
12
12
v-model =" formProps.labelWidth"
13
13
style =" width : 70px ; margin-right : 6px ;"
14
- size =" mini "
14
+ size =" small "
15
15
:format-tooltip =" sliderFormat"
16
16
></el-slider >
17
17
</template >
23
23
:min =" 3"
24
24
:max =" 15"
25
25
style =" width : 70px ; margin-right : 6px ;"
26
- size =" mini "
26
+ size =" small "
27
27
></el-slider >
28
28
<span style =" font-size : 13px ;" >wrapperCol:</span >
29
29
<el-slider
30
30
v-model =" formProps.wrapperColSpan"
31
31
:min =" 5"
32
32
:max =" 24"
33
33
style =" width : 70px ; margin-right : 6px ;"
34
- size =" mini "
34
+ size =" small "
35
35
></el-slider >
36
36
</template >
37
37
38
38
<el-checkbox
39
39
v-model =" formProps.inline"
40
40
style =" margin-right : 6px ;"
41
- size =" mini "
41
+ size =" small "
42
42
>
43
43
Inline
44
44
</el-checkbox >
45
45
<el-checkbox
46
46
v-model =" formFooter.show"
47
47
style =" margin-right : 6px ;"
48
- size =" mini "
48
+ size =" small "
49
49
>
50
50
底部
51
51
</el-checkbox >
178
178
<el-select
179
179
v-model =" curVueForm"
180
180
placeholder =" ui"
181
- size =" mini "
181
+ size =" small "
182
182
style =" margin-left : 10px ;width : 130px ;"
183
183
@change =" handleUiChange"
184
184
>
@@ -252,6 +252,31 @@ const VueAntForm = defineAsyncComponent(async () => {
252
252
};
253
253
});
254
254
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
+
255
280
const typeItems = Object .keys (schemaTypes);
256
281
257
282
export default {
@@ -260,6 +285,7 @@ export default {
260
285
CodeEditor,
261
286
VueElementForm,
262
287
VueAntForm,
288
+ VueNaiveForm,
263
289
EditorHeader
264
290
},
265
291
data () {
@@ -271,8 +297,11 @@ export default {
271
297
name: ' ElementPlus' ,
272
298
component: ' VueElementForm'
273
299
}, {
274
- name: ' antdv ' ,
300
+ name: ' Antdv ' ,
275
301
component: ' VueAntForm'
302
+ }, {
303
+ name: ' Naive' ,
304
+ component: ' VueNaiveForm'
276
305
}],
277
306
customFormats: {
278
307
price (value ) {
@@ -286,7 +315,7 @@ export default {
286
315
return this .$route .query .type ;
287
316
},
288
317
isUseLabelWidth () {
289
- return this .curVueForm === ' VueElementForm ' ;
318
+ return this .curVueForm !== ' VueAntForm ' ;
290
319
},
291
320
trueFormProps () {
292
321
if (! this .formProps ) return {};
@@ -311,16 +340,16 @@ export default {
311
340
};
312
341
},
313
342
trueFormFooter () {
314
- const {
315
- labelColSpan ,
316
- wrapperColSpan
317
- } = this .formProps ;
343
+ // const {
344
+ // labelColSpan,
345
+ // wrapperColSpan
346
+ // } = this.formProps;
318
347
319
348
return this .isUseLabelWidth ? (this .formFooter || {}) : {
320
349
formItemAttrs: {
321
350
wrapperCol: {
322
- span: wrapperColSpan ,
323
- offset: labelColSpan
351
+ span: 24 ,
352
+ offset: 0
324
353
}
325
354
}
326
355
};
@@ -407,7 +436,7 @@ export default {
407
436
labelPosition: ' top' ,
408
437
inlineFooter: false ,
409
438
labelColSpan: 10 ,
410
- wrapperColSpan: 12 ,
439
+ wrapperColSpan: 24 ,
411
440
layoutColumn: 1
412
441
},
413
442
};
0 commit comments