开启自定义渲染,编写Render函数
    image.png

    1. export function register (VisionCanvasLBus) {
    2. VisionCanvasLBus.registerComponent(LabelText, 'LabelText')
    3. VisionCanvasLBus.registerComponent(BaseVisionLContainer, 'BaseVisionLContainer')
    4. VisionCanvasLBus.registerComponent(FormVisionLContainer, 'FormVisionLContainer', FormVisionLContainerView)
    5. VisionCanvasLBus.registerComponent(AbsVisionLContainer, 'AbsVisionLContainer')
    6. VisionCanvasLBus.registerComponent(ModalVisionLContainer, 'ModalVisionLContainer')
    7. VisionCanvasLBus.registerComponent(TabsVisionLContainer, 'TabsVisionLContainer')
    8. VisionCanvasLBus.registerComponent(ButtonCom, 'Button')
    9. VisionCanvasLBus.registerComponent(InputCom, 'Input', ViewInputCom)
    10. VisionCanvasLBus.registerComponent(VisionTable, 'VisionTable', ViewVisionTable)
    11. VisionCanvasLBus.registerComponent(InputNumber, 'InputNumber', ViewInputNumber)
    12. VisionCanvasLBus.registerComponent(VisionImg, 'VisionImg')
    13. VisionCanvasLBus.registerComponent(Radio, 'Radio', RadioView)
    14. VisionCanvasLBus.registerComponent(Select, 'Select', SelectView)
    15. VisionCanvasLBus.registerComponent(Checkbox, 'Checkbox', CheckboxView)
    16. VisionCanvasLBus.registerComponent(DatePicker, 'DatePicker', DatePickerView)
    17. VisionCanvasLBus.registerComponent(DateRangePicker, 'DateRangePicker', DateRangePickerView)
    18. VisionCanvasLBus.registerComponent(Tree, 'Tree', TreeView)
    19. VisionCanvasLBus.registerComponent(VisionSwitch, 'VisionSwitch', VisionSwitchView)
    20. }
    1. function Render(ctx, args) {
    2. if (ctx) {
    3. // 查看有哪些可用组件。
    4. console.log(ctx.getComponentAll());
    5. // 获取注册组件
    6. const coms = ctx.getComponent("InputNumber");
    7. // 获取注册组件的 Class
    8. const MyInputNumber = coms.component;
    9. // 使用
    10. return <MyInputNumber
    11. change={(value) => {
    12. console.log(value);
    13. }}
    14. />
    15. }
    16. return ""
    17. }