@acaciomartins/react-native-simpletable 中文文档教程
@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
Prop | Type | Default | Description | Example |
---|---|---|---|---|
data | Array | - | 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" }] |
headerName | Array | - | Headers names and headers size | [{ name: "Name", size: 70 }, { name: "Description", size: 120 }, { name: "Amount", size: 80 }, { name: "Price", size: 70 }] |
columnName | Array | - | Columns names | ["name", "description", "amount", "price"] |