Open xgqfrms opened 5 years ago
https://codesandbox.io/s/7l2qm96mq https://codesandbox.io/s/rlj54x575q
const json = "600000,浦发银行,600000,600000.SH,1120;600001,邯郸钢铁(退市),600001,600001.SH,1121;600002,齐鲁石化(退市),600002,600002.SH,1123;600003,ST东北高(退市),600003,600003.SH,1124;600004,白云机场,600004,600004.SH,1125;600005,武钢股份(退市),600005,600005.SH,1127;600006,东风汽车,600006,600006.SH,1128;600007,中国国贸,600007,600007.SH,1129;600008,首创股份,600008,600008.SH,1130;600009,上海机场,600009,600009.SH,1131;";
arr = json.split(`;`).filter(item => item !== "");
// ["600000,浦发银行,600000,600000.SH,1120", "600001,邯郸钢铁(退市),600001,600001.SH,1121", "600002,齐鲁石化(退市),600002,600002.SH,1123", "600003,ST东北高(退市),600003,600003.SH,1124", "600004,白云机场,600004,600004.SH,1125", "600005,武钢股份(退市),600005,600005.SH,1127", "600006,东风汽车,600006,600006.SH,1128", "600007,中国国贸,600007,600007.SH,1129", "600008,首创股份,600008,600008.SH,1130", "600009,上海机场,600009,600009.SH,1131"]
obj = arr.forEach(
(str, i) => {
//
}
);
https://stackoverflow.com/users/5934465/xgqfrms https://stackoverflow.com/users/8629798/xgqfrms-gildata
https://stackoverflow.com/questions/4647817/javascript-object-rename-key
https://stackoverflow.com/questions/42148920/array-of-array-to-object-javascript https://stackoverflow.com/questions/52007559/convert-nested-array-to-an-object https://stackoverflow.com/questions/41580330/object-to-array-an-array-of-arrays
https://stackoverflow.com/questions/1869091/how-to-convert-an-array-to-object-in-php
https://www.cnblogs.com/xgqfrms/p/10109703.html https://www.cnblogs.com/xgqfrms/tag/SVN/
Line charts missing points
https://www.highcharts.com/demo/area-missing
null
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, null, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
/* data: [29.9, '', 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], */
}]
});
https://codesandbox.io/s/vjpymv7mq5
import React, { Component } from "react";
import ReactDOM from "react-dom";
// import PropTypes from 'prop-types';
import "antd/dist/antd.css";
import "./index.css";
import { Table } from "antd";
class APP extends Component {
constructor(props, context) {
super(props, context);
this.state = {
visible: true,
uid: ""
};
}
// auto bind this
getRowUid = e => {
// console.log(`e.target =`, e.target);
// console.log(`e.target.dataset =`, e.target.dataset);
// console.log(`e.target.value =`, e.target.value);
let uid = e.target.dataset.uid;
console.log(`uid =`, uid);
this.setState({
uid
});
};
render() {
const columns = [
{
title: "Name",
dataIndex: "name",
key: "name"
},
{
title: "Age",
dataIndex: "age",
key: "age"
},
{
title: "Address",
dataIndex: "address",
key: "address"
},
{
title: "Action",
dataIndex: "action",
key: "action",
render: (text, record) => {
// console.log(`text =`, text);
// console.log(`record =`, record);
return (
<a
href="javascript:;"
data-uid={record.name}
className=""
onClick={e => this.getRowUid(e)}
>
查看
</a>
);
}
}
];
const data = [
{
key: 1,
name: "John Brown",
age: 32,
address: "New York No. 1 Lake Park",
description:
"My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park."
},
{
key: 2,
name: "Jim Green",
age: 42,
address: "London No. 1 Lake Park",
description:
"My name is Jim Green, I am 42 years old, living in London No. 1 Lake Park."
},
{
key: 3,
name: "Joe Black",
age: 32,
address: "Sidney No. 1 Lake Park",
description:
"My name is Joe Black, I am 32 years old, living in Sidney No. 1 Lake Park."
}
];
return (
<Table
columns={columns}
expandedRowRender={record => (
<p style={{ margin: 0 }}>{record.description}</p>
)}
dataSource={data}
/>
);
}
}
// export default APP;
// export {APP};
ReactDOM.render(<APP />, document.getElementById("container"));
null
bugdate-picker 如何设置可以显示中文呀?
https://github.com/ant-design/ant-design/issues?utf8=%E2%9C%93&q=datepicker import 'moment/locale/zh-cn' https://codesandbox.io/s/4znnm58109 https://github.com/ant-design/ant-design/issues/11464#issuecomment-425308789 https://ant.design/components/locale-provider-cn/
<form>
cannot appear as a descendant of<form>
. See OptionsItems > Form > form > ... > Table > Table > TableRow > TableCell > Form(WrappedComponent) > (unknown) > App > Form > form.form 后代 bug
auto-complete & keyboard-ghost
https://codesandbox.io/s/7l2qm96mq
https://ant.design/components/auto-complete-cn/