1,使用switch...case...效果
2,主要代码
switch (num) {
case 1 :
return (<span>{}</span>);
break;
case 2 :
return (<span> {}</span>);
break;
default :
return (<span> {}</span>);
break;
}
};
3,详细代码
import React, { PureComponent } from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'dva';
import { Row, Col, Table, Radio, Input, Form, Button, Icon, DatePicker, Select, Modal, Popconfirm, Checkbox, message, Tag,
TreeSelect,Menu,Dropdown, Tree,notification,Alert,Upload,Popover
} from 'antd';
import styles from './studentsList.less';
const TreeNode = TreeSelect.TreeNode;
const FormItem = Form.Item;
const RadioButton = Radio.Button;
const RadioGroup = Radio.Group;
const SelectOption = Select.Option;
const { Search, TextArea } = Input;
const dateFormat = 'YYYY/MM/DD';
const treeData = [{}];
@Form.create()
class StudentsList extends PureComponent {
batch = value =>{
this.setS