React 表格

Posted zhanglanzuopin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了React 表格相关的知识,希望对你有一定的参考价值。

this.dataSourcesa = [
{
score_name: "业务系统",
score_image_url: (
<Select
// defaultValue={this.state.applyFloatIPServiceSystem}
value={this.state.applyFloatIPServiceSystem}
className="placeSelectDataCenter"
id="select"
onChange={e => {
this.setState({ applyFloatIPServiceSystem: e });
}}
>
{this.state.serviceSystemList.map((item, key) => {
return (
<Option value={item.name} key={key}>
{item.name}
</Option>
);
})}
</Select>
)
},
{
score_name: "集群",
score_image_url: (
<Select
// defaultValue={this.state.applyFloatIPColony}
value={this.state.applyFloatIPColony}
className="placeSelectDataCenter"
id="select"
onChange={e => {
this.setState({ applyFloatIPColony: e });
}}
>
<Option value={1}>主集群</Option>
<Option value={2}>备集群</Option>
</Select>
)
},
{
score_name: "数量",
score_image_url: (
<Input
defaultValue="请输入数量"
value={this.state.applyFloatIPNum}
onChange={e => {
this.setState({ applyFloatIPNum: e.target.value });
}}
onClick={() => {
if (this.state.applyFloatIPNum == "请输入数量") {
this.setState({ applyFloatIPNum: "" });
} else {
return;
}
}}
></Input>
)
}
];

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------

render: text => {
if (text === "Created") {
return <span className="color_blue">已创建</span>;
} else if (text === "Designing") {
return <span>设计中</span>;
} else if (text === "Training") {
return <span>训练中</span>;
} else if (text === "Trained") {
return <span>训练完成</span>;
} else if (text === "Testing") {
return <span>测试中</span>;
} else if (text === "Tested") {
return <span>测试完成</span>;
} else if (text === "Scored") {
return <span>打分完成</span>;
}
}
},

以上是关于React 表格的主要内容,如果未能解决你的问题,请参考以下文章

React 表格​​重新渲染,在表格单元格中输入文本时失去焦点

通过单击编辑按钮编辑表格单元格值 - React

antDesign+react实现表格

如何使表格占据所有水平空间 TailwindCSS (React)

Griddle, griddle-react 一个REACT 表格组件

react 表格单元格拖拽