particlec
0.01D
V2EX  ›  问与答

前端,请问这里 TS 如何定义数据类型?

  •  
  •   particlec · Jun 13, 2022 · 1789 views
    This topic created in 1455 days ago, the information mentioned may be changed or developed.
    使用技术 react + antd +TS
    const columns: ColumnsType<DataType> = [
    {
    title: "创建者",
    dataIndex: "creator",
    key: "creator",
    },
    .....]

    <Table
    columns={columns}
    dataSource={analogDataTable(columns)}
    />

    // 这是一个自定义通用模拟表格数据的方法
    export const analogDataTable = (columns: (请问这里该如何定义类型?)) => {.......}
    2 replies    2022-06-13 17:47:02 +08:00
    RNAer
        1
    RNAer  
       Jun 13, 2022
    ColumnsType<DataType>
    iidear2015
        2
    iidear2015  
       Jun 13, 2022
    <T>(x: ColumnsType<T>) => ColumnsType<T>
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4038 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 05:13 · PVG 13:13 · LAX 22:13 · JFK 01:13
    ♥ Do have faith in what you're doing.