File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import 'zui-dev' ;
22import type { ComponentType } from 'preact' ;
33import yaml from 'js-yaml' ;
4- import { $ } from '@zui/core' ;
4+ import { $ , jsx } from '@zui/core' ;
55import '@zui/button' ;
66import '@zui/icons' ;
77import '@zui/btn-group' ;
@@ -37,6 +37,9 @@ onPageUpdate(() => {
3737 defaultData,
3838 widgets : {
3939 progressCircle : ( { value} ) => [ ProgressCircle as unknown as ComponentType , { percent : value || 0 } ] ,
40+ customComponent : [ ( props : Record < string , unknown > ) => {
41+ return jsx `<div class="form-static-text">${ props . value } </div>` ;
42+ } ] ,
4043 } ,
4144 onSubmit : ( event , data ) => {
4245 console . log ( 'onSubmit' , event , data ) ;
Original file line number Diff line number Diff line change @@ -251,6 +251,12 @@ export const schema = {
251251 } ,
252252 extra : { html : '此处为了展示进度环的值的改变会触发表单项 <code>specials.progressCircle</code> 值的改变,使<strong>进度环</strong>显示新的值。' } ,
253253 } ,
254+ customComponent : {
255+ title : '自定义组件' ,
256+ type : 'string' ,
257+ defaultValue : '这是自定义组件的默认值' ,
258+ widget : 'customComponent'
259+ }
254260 } ,
255261 } ,
256262 } ,
You can’t perform that action at this time.
0 commit comments