寻求帮助:前端自定义组件属性定义和数据交互
KingK_
2021.12.07 22:40发布于技术 - 前端与UI
3961

1、目前学习进度:

本论坛内的开发教程和视频我已尽数看完。

2、存在问题:

目前对component文件下的antd组件和对应的(组件名.tsx)数据如何交互不知如何下手

不是editorConfig和editorPreview的tsx

请问是否有教程或文档,不胜感激!

首赞
收藏
0评论
···
1个回答
按时间排序
按点赞排序
    小艺001
    官方
    2021-12-08 10:32 发布

    举个例子

    <property key="activeKey" type="attribute" required="false">
      <caption>活动tab页</caption>
      <description></description>
      <attributeTypes>
        <attributeType name="String" />
      </attributeTypes>
    </property>
    

    会生成如下typing

    export interface TabsContainerProps {
        name: string;
        class: string;
        style?: CSSProperties;
        tabIndex?: number;
        activeKey?: EditableValue<string>;
        tabs: TabsType[];
        customHeader: boolean;
        centered: boolean;
        tabPosition: TabPositionEnum;
    }
    

    props.activeKey.status变成available时,你就可以拿到最新的值props.activeKey.value

    KingK_、大唐智联-窦浴智
    点赞
    4评论
    举报