particlec
0.01D
V2EX  ›  问与答

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

  •  
  •   particlec · Jun 13, 2022 · 2141 views
    This topic created in 1606 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
    RNAer
    Jun 13, 2022
    1
    ColumnsType<DataType>
    iidear2015
    iidear2015
    Jun 13, 2022
    2
    <T>(x: ColumnsType<T>) => ColumnsType<T>
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5567 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 03:29 · PVG 11:29 · LAX 19:29 · JFK 22:29
    ♥ Do have faith in what you're doing.