@acaciomartins/react-native-simpletable 中文文档教程

发布于 5年前 浏览 23 项目主页 更新于 3年前

@acaciomartins/react-native-simpletable

React Native 简单表是 React Native 的一个组件。

Instructions to Install

npm install @acaciomartins/react-native-simpletable

Instructions to Usage

import SimpleTable from '@acaciomartins/react-native-simpletable';
const headerName = [{ name: "Name", size: 70 }, { name: "Description", size: 120 }, { name: "Amount", size: 80 }, { name: "Price", size: 70 }];
const columnName = ["name", "description", "amount", "price"];
const tableData = [
  { name: "Product 1", description: "Description Product 1", price: "1,99", amount: "1" }, 
  { name: "Product 2", description: "Description Product 2", price: "2,99", amount: "2" }];

<SimpleTable
    data={tableData}
    headerName={headerName}
    columnName={columnName}
/>

道具

  • data
  • headerName
  • columnName

<头> <正文>
支持类型默认描述例子
数据数组-表格中显示的数据[{ name: "产品 1", description: "描述产品 1", price: "1,99", amount: "1" },{ name: "Product 2", description: "描述产品 2" , 价格: "2,99", 数量: "2" }]
标题名称数组-标题名称和标题大小[{ name: "Name", size: 70 }, { name: "Description", size: 120 }, { name: "Amount", size: 80 }, { name: "Price", size: 70 }]
列名数组-列名["名称", "描述", "数量", "价格"]

@acaciomartins/react-native-simpletable

A React Native Simple Table is a component React Native.

Instructions to Install

npm install @acaciomartins/react-native-simpletable

Instructions to Usage

import SimpleTable from '@acaciomartins/react-native-simpletable';
const headerName = [{ name: "Name", size: 70 }, { name: "Description", size: 120 }, { name: "Amount", size: 80 }, { name: "Price", size: 70 }];
const columnName = ["name", "description", "amount", "price"];
const tableData = [
  { name: "Product 1", description: "Description Product 1", price: "1,99", amount: "1" }, 
  { name: "Product 2", description: "Description Product 2", price: "2,99", amount: "2" }];

<SimpleTable
    data={tableData}
    headerName={headerName}
    columnName={columnName}
/>

Props

  • data
  • headerName
  • columnName

PropTypeDefaultDescriptionExample
dataArray-Data displayed in the table[{ name: "Product 1", description: "Description Product 1", price: "1,99", amount: "1" },{ name: "Product 2", description: "Description Product 2", price: "2,99", amount: "2" }]
headerNameArray-Headers names and headers size[{ name: "Name", size: 70 }, { name: "Description", size: 120 }, { name: "Amount", size: 80 }, { name: "Price", size: 70 }]
columnNameArray-Columns names["name", "description", "amount", "price"]

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文