mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
improve demo es6 class code style
This commit is contained in:
parent
2da59c3679
commit
f2d12306bd
@ -37,11 +37,8 @@ const columns = [{
|
||||
}];
|
||||
|
||||
class Page extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
visible: false,
|
||||
};
|
||||
state = {
|
||||
visible: false,
|
||||
}
|
||||
showModal = () => {
|
||||
this.setState({ visible: true });
|
||||
|
@ -17,13 +17,11 @@ Wrap your app with `LocaleProvider`, and apply the corresponding language packag
|
||||
import { Pagination, LocaleProvider } from 'antd';
|
||||
import enUS from 'antd/lib/locale-provider/en_US';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div>
|
||||
<Pagination defaultCurrent={1} total={50} showSizeChanger />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const App = () = >(
|
||||
<div>
|
||||
<Pagination defaultCurrent={1} total={50} showSizeChanger />
|
||||
</div>
|
||||
};
|
||||
|
||||
ReactDOM.render(
|
||||
<LocaleProvider locale={enUS}>
|
||||
|
@ -19,12 +19,9 @@ import { Mention } from 'antd';
|
||||
const users = ['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai'];
|
||||
|
||||
class AsyncMention extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
suggestions: [],
|
||||
loading: false,
|
||||
};
|
||||
state = {
|
||||
suggestions: [],
|
||||
loading: false,
|
||||
}
|
||||
fetchSuggestions(value, callback) {
|
||||
setTimeout(() => {
|
||||
|
@ -27,11 +27,8 @@ const webFrameworks = [
|
||||
];
|
||||
|
||||
class CustomNavMention extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
suggestions: [],
|
||||
};
|
||||
state = {
|
||||
suggestions: [],
|
||||
}
|
||||
onSearchChange = (value) => {
|
||||
const searchValue = value.toLowerCase();
|
||||
|
@ -18,11 +18,8 @@ import { Mention } from 'antd';
|
||||
const { toEditorState } = Mention;
|
||||
|
||||
class App extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
value: toEditorState('@afc163'),
|
||||
};
|
||||
state = {
|
||||
value: toEditorState('@afc163'),
|
||||
}
|
||||
handleChange = (editorState) => {
|
||||
this.setState({
|
||||
|
@ -19,11 +19,8 @@ const { toEditorState, getMentions } = Mention;
|
||||
const FormItem = Form.Item;
|
||||
|
||||
class App extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
initValue: toEditorState('@afc163'),
|
||||
};
|
||||
state = {
|
||||
initValue: toEditorState('@afc163'),
|
||||
}
|
||||
handleReset = (e) => {
|
||||
e.preventDefault();
|
||||
|
@ -32,11 +32,8 @@ function onSelect(suggestion, data) {
|
||||
}
|
||||
|
||||
class CustomNavMention extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
suggestions: [],
|
||||
};
|
||||
state = {
|
||||
suggestions: [],
|
||||
}
|
||||
onSearchChange = (value) => {
|
||||
const searchValue = value.toLowerCase();
|
||||
|
Loading…
Reference in New Issue
Block a user