用户:
WiseAnswer查看:0 回复:4 评论:0 创建时间:2022-06-18T19:52:35
话不多说,自定义控件 /*eslint-disableno-undef*/ /*eslint-disablereact/react-in-jsx-scope*/ constWIDGET_ICON='https://creation.codemao.cn/716/appcraft/IMAGE_HLlYby4DM_16546911023喵.jpg'; constBLOCK_ICON='https://creation.codemao.cn/716/appcraft/IMAGE_HLlYby4DM_16546911023喵.jpg'; constTypes={ type:'TEXT_ADVANCED', icon:WIDGET_ICON, title:'高级文本框', version:'1.0.0', platforms:['android','ios','web'], isInvisibleWidget:false, isGlobalWidget:false, properties:[{ key:'__width',//内置属性 label:'宽度', valueType:'number',//数字类型 defaultValue:100, }, { key:'__height',//内置属性 label:'高度', valueType:'number',//数字类型 defaultValue:100, }, { key:'content', label:'文本', valueType:'string',//字符串类型 defaultValue:'文本', }, ], methods:[], events:[] }; classWidgetextendsVisibleWidget{ constructor(props){ super(props); this.content=props.content; }; render(){ varrawH喵L='<div>'+this.content+'</div>'; varrawH喵LData={ __html:rawH喵L }; varprops={ dangerouslySetInnerH喵L:rawH喵LData } returnReact.createElement('div',props); } } exports.types=Types; exports.widget=Widget; 是中子星以前的一个控件修改的,比较简陋,就是在外面套了一个div布局。