From 009ed0858009f3b5f8602f2306749fb01409bf2d Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 27 Jun 2018 15:55:04 +0800 Subject: [PATCH] upgrade eslint-config-airbnb --- .eslintrc.js | 9 ++----- components/affix/demo/basic.md | 6 ++--- components/alert/demo/banner.md | 4 ++-- components/alert/demo/basic.md | 4 ++-- components/alert/demo/closable.md | 4 ++-- components/alert/demo/close-text.md | 4 ++-- components/alert/demo/description.md | 4 ++-- components/alert/demo/icon.md | 4 ++-- components/alert/demo/smooth-closed.md | 6 +++-- components/alert/demo/style.md | 4 ++-- components/anchor/demo/basic.md | 5 ++-- components/anchor/demo/static.md | 5 ++-- .../auto-complete/demo/certain-category.md | 1 + components/auto-complete/demo/custom.md | 1 + .../auto-complete/demo/uncertain-category.md | 1 + components/avatar/demo/badge.md | 4 ++-- components/avatar/demo/basic.md | 4 ++-- components/avatar/demo/dynamic.md | 6 +++-- components/avatar/demo/type.md | 4 ++-- components/badge/demo/basic.md | 4 ++-- components/badge/demo/change.md | 1 + components/badge/demo/dot.md | 4 ++-- components/badge/demo/link.md | 4 ++-- components/badge/demo/no-wrapper.md | 4 ++-- components/badge/demo/overflow.md | 4 ++-- components/badge/demo/status.md | 4 ++-- components/badge/demo/title.md | 4 ++-- components/breadcrumb/demo/basic.md | 4 ++-- components/breadcrumb/demo/router-4.md | 4 ++-- components/breadcrumb/demo/router.md | 4 ++-- components/breadcrumb/demo/separator.md | 4 ++-- components/breadcrumb/demo/withIcon.md | 4 ++-- components/button/demo/basic.md | 4 ++-- components/button/demo/button-group.md | 1 + components/button/demo/ghost.md | 4 ++-- components/calendar/demo/basic.md | 4 ++-- components/calendar/demo/card.md | 4 ++-- components/calendar/demo/notice-calendar.md | 4 ++-- components/calendar/demo/select.md | 3 +++ components/card/demo/basic.md | 4 ++-- components/card/demo/border-less.md | 4 ++-- components/card/demo/flexible-content.md | 5 ++-- components/card/demo/grid-card.md | 4 ++-- components/card/demo/in-column.md | 4 ++-- components/card/demo/inner.md | 4 ++-- components/card/demo/loading.md | 4 ++-- components/card/demo/meta.md | 5 ++-- components/card/demo/simple.md | 4 ++-- components/card/demo/tabs.md | 6 +++-- components/carousel/demo/autoplay.md | 4 ++-- components/carousel/demo/basic.md | 4 ++-- components/carousel/demo/fade.md | 4 ++-- components/carousel/demo/vertical.md | 4 ++-- components/cascader/demo/basic.md | 4 ++-- components/cascader/demo/change-on-select.md | 4 ++-- components/cascader/demo/custom-render.md | 4 ++-- components/cascader/demo/custom-trigger.md | 1 + components/cascader/demo/default-value.md | 4 ++-- components/cascader/demo/disabled-option.md | 4 ++-- components/cascader/demo/fileds-name.md | 4 ++-- components/cascader/demo/hover.md | 4 ++-- components/cascader/demo/lazy.md | 3 +++ components/cascader/demo/size.md | 4 ++-- components/checkbox/demo/basic.md | 4 ++-- components/checkbox/demo/check-all.md | 4 ++++ components/checkbox/demo/controller.md | 4 ++++ components/checkbox/demo/disabled.md | 4 ++-- components/checkbox/demo/group.md | 5 ++-- components/collapse/demo/accordion.md | 5 ++-- components/collapse/demo/basic.md | 5 ++-- components/collapse/demo/borderless.md | 5 ++-- components/collapse/demo/custom.md | 5 ++-- components/collapse/demo/mix.md | 5 ++-- components/collapse/demo/noarrow.md | 5 ++-- components/date-picker/demo/basic.md | 5 ++-- components/date-picker/demo/date-render.md | 5 ++-- components/date-picker/demo/disabled-date.md | 1 + components/date-picker/demo/disabled.md | 5 ++-- components/date-picker/demo/extra-footer.md | 5 ++-- components/date-picker/demo/format.md | 5 ++-- components/date-picker/demo/mode.md | 5 ++-- .../date-picker/demo/presetted-ranges.md | 1 + components/date-picker/demo/size.md | 1 + components/date-picker/demo/time.md | 5 ++-- components/divider/demo/horizontal.md | 4 ++-- components/divider/demo/orientation.md | 4 ++-- components/divider/demo/vertical.md | 4 ++-- components/dropdown/demo/basic.md | 4 ++-- components/dropdown/demo/context-menu.md | 4 ++-- components/dropdown/demo/dropdown-button.md | 4 ++-- components/dropdown/demo/event.md | 5 ++-- components/dropdown/demo/item.md | 4 ++-- components/dropdown/demo/overlay-visible.md | 3 +++ components/dropdown/demo/placement.md | 4 ++-- components/dropdown/demo/sub-menu.md | 5 ++-- components/dropdown/demo/trigger.md | 4 ++-- components/form/demo/advanced-search.md | 1 + components/form/demo/coordinated.md | 3 +++ .../form/demo/customized-form-controls.md | 8 +++++++ components/form/demo/dynamic-form-item.md | 1 + components/form/demo/dynamic-rule.md | 4 ++++ components/form/demo/form-in-modal.md | 6 +++++ components/form/demo/global-state.md | 3 +++ components/form/demo/horizontal-login.md | 3 +++ components/form/demo/layout.md | 3 +++ components/form/demo/normal-login.md | 2 ++ components/form/demo/register.md | 7 ++++++ components/form/demo/time-related-controls.md | 2 ++ components/form/demo/validate-other.md | 3 +++ components/form/demo/validate-static.md | 5 ++-- components/form/demo/without-form-create.md | 3 +++ components/grid/demo/gutter.md | 4 ++-- components/grid/demo/playground.md | 5 ++++ components/grid/demo/responsive-more.md | 4 ++-- components/grid/demo/responsive.md | 4 ++-- components/input-number/demo/basic.md | 4 ++-- components/input-number/demo/digit.md | 4 ++-- components/input-number/demo/disabled.md | 2 ++ components/input-number/demo/formatter.md | 4 ++-- components/input-number/demo/size.md | 4 ++-- components/input/demo/addon.md | 5 ++-- components/input/demo/autosize-textarea.md | 5 ++-- components/input/demo/group.md | 3 +++ components/input/demo/presuffix.md | 3 +++ components/input/demo/search-input.md | 5 ++-- components/input/demo/size.md | 4 ++-- components/input/demo/textarea.md | 1 + components/input/demo/tooltip.md | 4 ++++ components/layout/demo/basic.md | 5 ++-- components/layout/demo/custom-trigger.md | 3 +++ components/layout/demo/fixed-sider.md | 5 ++-- components/layout/demo/fixed.md | 5 ++-- components/layout/demo/responsive.md | 5 ++-- components/layout/demo/side.md | 3 +++ components/layout/demo/top-side-2.md | 5 ++-- components/layout/demo/top-side.md | 5 ++-- components/layout/demo/top.md | 5 ++-- components/list/demo/basic.md | 4 ++-- components/list/demo/grid.md | 4 ++-- components/list/demo/infinite-load.md | 4 ++++ .../list/demo/infinite-virtualized-load.md | 7 ++++++ components/list/demo/loadmore.md | 4 ++++ components/list/demo/resposive.md | 4 ++-- components/list/demo/simple.md | 4 ++-- components/list/demo/vertical.md | 4 ++-- components/locale-provider/demo/all.md | 8 ++++++- components/locale-provider/demo/basic.md | 4 ++-- components/mention/demo/async.md | 3 +++ components/mention/demo/avatar.md | 6 +++-- components/mention/demo/basic.md | 5 ++-- components/mention/demo/controllder-simple.md | 4 ++++ components/mention/demo/controlled.md | 5 ++++ components/mention/demo/custom-tag.md | 6 +++-- components/mention/demo/multilines.md | 5 ++-- components/mention/demo/multiple-trigger.md | 7 ++++-- components/mention/demo/placement.md | 5 ++-- components/mention/demo/popupContainer.md | 3 +++ components/mention/demo/readonly.md | 5 ++-- components/menu/demo/horizontal.md | 3 +++ components/menu/demo/inline-collapsed.md | 3 +++ components/menu/demo/inline.md | 2 ++ components/menu/demo/sider-current.md | 4 ++++ components/menu/demo/switch-mode.md | 4 ++++ components/menu/demo/theme.md | 4 ++++ components/menu/demo/vertical.md | 5 ++-- components/message/demo/duration.md | 4 ++-- components/message/demo/info.md | 4 ++-- components/message/demo/loading.md | 4 ++-- components/message/demo/other.md | 4 ++-- components/message/demo/thenable.md | 4 ++-- components/modal/demo/async.md | 4 ++++ components/modal/demo/basic.md | 4 ++++ components/modal/demo/confirm-promise.md | 5 ++-- components/modal/demo/confirm.md | 5 ++-- components/modal/demo/footer.md | 4 ++++ components/modal/demo/locale.md | 3 +++ components/modal/demo/position.md | 3 +++ components/notification/demo/basic.md | 4 ++-- components/notification/demo/custom-icon.md | 4 ++-- components/notification/demo/custom-style.md | 4 ++-- components/notification/demo/duration.md | 4 ++-- components/notification/demo/placement.md | 4 ++-- components/notification/demo/update.md | 4 ++-- components/notification/demo/with-btn.md | 4 ++-- components/notification/demo/with-icon.md | 4 ++-- components/pagination/demo/changer.md | 4 ++-- components/pagination/demo/controlled.md | 2 ++ components/pagination/demo/itemRender.md | 6 ++--- components/pagination/demo/mini.md | 4 ++-- components/pagination/demo/more.md | 4 ++-- components/pagination/demo/simple.md | 4 ++-- components/pagination/demo/total.md | 4 ++-- components/popconfirm/demo/basic.md | 4 ++-- components/popconfirm/demo/dynamic-trigger.md | 5 ++++ components/popconfirm/demo/locale.md | 4 ++-- components/popconfirm/demo/placement.md | 4 ++-- .../popover/demo/arrow-point-at-center.md | 4 ++-- components/popover/demo/basic.md | 4 ++-- components/popover/demo/control.md | 3 +++ components/popover/demo/placement.md | 4 ++-- components/popover/demo/triggerType.md | 4 ++-- components/progress/demo/circle-dynamic.md | 4 ++++ components/progress/demo/circle-mini.md | 4 ++-- components/progress/demo/circle.md | 4 ++-- components/progress/demo/dynamic.md | 4 ++++ components/progress/demo/format.md | 4 ++-- components/progress/demo/line-mini.md | 4 ++-- components/progress/demo/line.md | 4 ++-- components/progress/demo/segment.md | 4 ++-- components/radio/demo/disable.md | 2 ++ components/radio/demo/radiobutton.md | 5 ++-- components/radio/demo/radiogroup-more.md | 3 +++ components/radio/demo/radiogroup-options.md | 5 ++++ components/radio/demo/radiogroup-with-name.md | 1 + components/radio/demo/radiogroup.md | 3 +++ components/radio/demo/size.md | 5 ++-- components/rate/demo/character.md | 4 ++-- components/rate/demo/clear.md | 4 ++-- components/rate/demo/text.md | 2 ++ .../select/demo/automatic-tokenization.md | 5 ++-- components/select/demo/basic.md | 5 ++-- components/select/demo/combobox.md | 3 +++ components/select/demo/coordinate.md | 4 ++++ components/select/demo/label-in-value.md | 5 ++-- components/select/demo/multiple.md | 5 ++-- components/select/demo/optgroup.md | 5 ++-- components/select/demo/search-box.md | 7 ++++-- components/select/demo/search.md | 5 ++-- components/select/demo/select-users.md | 5 ++++ components/select/demo/size.md | 1 + components/select/demo/tags.md | 5 ++-- components/slider/demo/basic.md | 2 ++ components/slider/demo/icon-slider.md | 2 ++ components/slider/demo/input-number.md | 8 +++++-- components/slider/demo/mark.md | 4 ++-- components/spin/demo/delayAndDebounce.md | 4 +++- components/spin/demo/inside.md | 4 ++-- components/spin/demo/nested.md | 2 ++ components/spin/demo/size.md | 4 ++-- components/spin/demo/tip.md | 4 ++-- .../steps/demo/customized-progress-dot.md | 5 ++-- components/steps/demo/error.md | 5 ++-- components/steps/demo/icon.md | 5 ++-- components/steps/demo/progress-dot.md | 5 ++-- components/steps/demo/simple.md | 5 ++-- components/steps/demo/small-size.md | 5 ++-- components/steps/demo/step-next.md | 13 ++++++---- components/steps/demo/vertical-small.md | 5 ++-- components/steps/demo/vertical.md | 5 ++-- components/switch/demo/disabled.md | 2 ++ components/switch/demo/loading.md | 4 ++-- components/switch/demo/size.md | 4 ++-- components/switch/demo/text.md | 4 ++-- components/table/demo/ajax.md | 4 ++++ components/table/demo/bordered.md | 4 ++-- components/table/demo/colspan-rowspan.md | 4 ++-- components/table/demo/custom-filter-panel.md | 7 ++++-- components/table/demo/dynamic-settings.md | 1 + components/table/demo/edit-cell.md | 24 ++++++++++++------- components/table/demo/edit-row.md | 6 +++++ components/table/demo/expand-children.md | 4 ++-- components/table/demo/expand.md | 4 ++-- components/table/demo/fixed-header.md | 4 ++-- components/table/demo/grouping-columns.md | 4 ++-- components/table/demo/head.md | 4 ++-- components/table/demo/jsx.md | 4 ++-- components/table/demo/reset-filter.md | 5 ++++ .../table/demo/row-selection-and-operation.md | 3 +++ components/table/demo/row-selection-custom.md | 2 ++ components/table/demo/row-selection.md | 4 ++-- components/table/demo/size.md | 4 ++-- components/tabs/demo/basic.md | 5 ++-- components/tabs/demo/card-top.md | 5 ++-- components/tabs/demo/card.md | 5 ++-- components/tabs/demo/custom-add-trigger.md | 5 ++++ components/tabs/demo/disabled.md | 5 ++-- components/tabs/demo/editable-card.md | 5 ++++ components/tabs/demo/extra.md | 5 ++-- components/tabs/demo/icon.md | 5 ++-- components/tabs/demo/position.md | 3 +++ components/tabs/demo/size.md | 3 +++ components/tabs/demo/slide.md | 3 +++ components/tag/demo/checkable.md | 7 ++++-- components/tag/demo/colorful.md | 4 ++-- components/tag/demo/hot-tags.md | 7 +++--- components/time-picker/demo/12hours.md | 4 ++-- components/time-picker/demo/disabled.md | 4 ++-- components/time-picker/demo/hide-column.md | 4 ++-- .../time-picker/demo/interval-options.md | 4 ++-- components/time-picker/demo/size.md | 4 ++-- components/timeline/demo/basic.md | 4 ++-- components/timeline/demo/color.md | 4 ++-- components/timeline/demo/custom.md | 4 ++-- .../tooltip/demo/arrow-point-at-center.md | 4 ++-- .../tooltip/demo/auto-adjust-overflow.md | 4 ++-- components/tooltip/demo/basic.md | 4 ++-- components/tooltip/demo/placement.md | 4 ++-- components/transfer/demo/advanced.md | 5 ++++ components/transfer/demo/basic.md | 4 ++-- components/transfer/demo/custom-item.md | 5 ++++ components/transfer/demo/large-data.md | 4 ++++ components/transfer/demo/search.md | 5 ++++ components/tree-select/demo/basic.md | 3 +++ components/tree-select/demo/checkable.md | 3 +++ components/tree-select/demo/multiple.md | 3 +++ components/tree-select/demo/treeData.md | 2 ++ components/tree/demo/basic-controlled.md | 6 +++++ components/tree/demo/basic.md | 3 +++ components/tree/demo/customized-icon.md | 1 + components/tree/demo/draggable.md | 4 ++++ components/tree/demo/dynamic.md | 4 ++++ components/tree/demo/line.md | 2 ++ components/tree/demo/search.md | 3 +++ components/upload/demo/avatar.md | 2 ++ components/upload/demo/basic.md | 4 ++-- components/upload/demo/defaultFileList.md | 4 ++-- components/upload/demo/drag.md | 5 ++-- components/upload/demo/fileList.md | 2 ++ components/upload/demo/picture-style.md | 4 ++-- package.json | 8 +++---- 320 files changed, 876 insertions(+), 456 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 928981c50d..b104d2adb6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,13 +8,6 @@ const eslintrc = { es6: true, }, parser: 'babel-eslint', - parserOptions: { - ecmaVersion: 6, - ecmaFeatures: { - jsx: true, - experimentalObjectRestSpread: true, - }, - }, plugins: [ 'markdown', 'react', @@ -65,6 +58,8 @@ if (process.env.RUN_ENV === 'DEMO') { 'eol-last': 0, 'no-script-url': 0, 'prefer-rest-params': 0, + 'react/no-access-state-in-setstate': 0, + 'react/destructuring-assignment': 0, 'react/no-multi-comp': 0, 'react/prefer-stateless-function': 0, 'jsx-a11y/href-no-hash': 0, diff --git a/components/affix/demo/basic.md b/components/affix/demo/basic.md index c1c45ce5fa..0d6e96d3e0 100644 --- a/components/affix/demo/basic.md +++ b/components/affix/demo/basic.md @@ -21,6 +21,7 @@ class Demo extends React.Component { top: 10, bottom: 10, } + render() { return (
@@ -54,8 +55,5 @@ class Demo extends React.Component { } } -ReactDOM.render( - , - mountNode -); +ReactDOM.render(, mountNode); ```` diff --git a/components/alert/demo/banner.md b/components/alert/demo/banner.md index 7e3a30b573..0eb3feed1c 100644 --- a/components/alert/demo/banner.md +++ b/components/alert/demo/banner.md @@ -26,6 +26,6 @@ ReactDOM.render(
-
-, mountNode); + , + mountNode); ```` diff --git a/components/alert/demo/basic.md b/components/alert/demo/basic.md index cf4d174a25..75f4a6818d 100644 --- a/components/alert/demo/basic.md +++ b/components/alert/demo/basic.md @@ -17,8 +17,8 @@ The simplest usage for short messages. import { Alert } from 'antd'; ReactDOM.render( - -, mountNode); + , + mountNode); ```` diff --git a/components/tabs/demo/basic.md b/components/tabs/demo/basic.md index 2862b961ed..11cc076da5 100644 --- a/components/tabs/demo/basic.md +++ b/components/tabs/demo/basic.md @@ -15,6 +15,7 @@ Default activate first tab. ````jsx import { Tabs } from 'antd'; + const TabPane = Tabs.TabPane; function callback(key) { @@ -26,6 +27,6 @@ ReactDOM.render( Content of Tab Pane 1 Content of Tab Pane 2 Content of Tab Pane 3 - -, mountNode); + , + mountNode); ```` diff --git a/components/tabs/demo/card-top.md b/components/tabs/demo/card-top.md index aa7c28ff0a..b8cee684de 100644 --- a/components/tabs/demo/card-top.md +++ b/components/tabs/demo/card-top.md @@ -15,6 +15,7 @@ Should be used at the top of container, needs to override styles. ````jsx import { Tabs } from 'antd'; + const TabPane = Tabs.TabPane; ReactDOM.render( @@ -36,8 +37,8 @@ ReactDOM.render(

Content of Tab Pane 3

- -, mountNode); + , + mountNode); ```` ````css diff --git a/components/tabs/demo/card.md b/components/tabs/demo/card.md index debed6cb1c..51ce1676d1 100644 --- a/components/tabs/demo/card.md +++ b/components/tabs/demo/card.md @@ -16,6 +16,7 @@ Another type Tabs, which doesn't support vertical mode. ````jsx import { Tabs } from 'antd'; + const TabPane = Tabs.TabPane; function callback(key) { @@ -27,6 +28,6 @@ ReactDOM.render( Content of Tab Pane 1 Content of Tab Pane 2 Content of Tab Pane 3 - -, mountNode); + , + mountNode); ```` diff --git a/components/tabs/demo/custom-add-trigger.md b/components/tabs/demo/custom-add-trigger.md index 46c9b76853..e9313b0440 100644 --- a/components/tabs/demo/custom-add-trigger.md +++ b/components/tabs/demo/custom-add-trigger.md @@ -15,6 +15,7 @@ Hide default plus icon, and bind event for customized trigger. ````jsx import { Tabs, Button } from 'antd'; + const TabPane = Tabs.TabPane; class Demo extends React.Component { @@ -34,15 +35,18 @@ class Demo extends React.Component { onChange = (activeKey) => { this.setState({ activeKey }); } + onEdit = (targetKey, action) => { this[action](targetKey); } + add = () => { const panes = this.state.panes; const activeKey = `newTab${this.newTabIndex++}`; panes.push({ title: 'New Tab', content: 'New Tab Pane', key: activeKey }); this.setState({ panes, activeKey }); } + remove = (targetKey) => { let activeKey = this.state.activeKey; let lastIndex; @@ -57,6 +61,7 @@ class Demo extends React.Component { } this.setState({ panes, activeKey }); } + render() { return (
diff --git a/components/tabs/demo/disabled.md b/components/tabs/demo/disabled.md index 5e06d2c283..c469c964c4 100644 --- a/components/tabs/demo/disabled.md +++ b/components/tabs/demo/disabled.md @@ -15,6 +15,7 @@ Disabled a tab. ````jsx import { Tabs } from 'antd'; + const TabPane = Tabs.TabPane; ReactDOM.render( @@ -22,6 +23,6 @@ ReactDOM.render( Tab 1 Tab 2 Tab 3 - -, mountNode); + , + mountNode); ```` diff --git a/components/tabs/demo/editable-card.md b/components/tabs/demo/editable-card.md index ff627cde28..af17573918 100644 --- a/components/tabs/demo/editable-card.md +++ b/components/tabs/demo/editable-card.md @@ -17,6 +17,7 @@ Only card type Tabs support adding & closable. ````jsx import { Tabs } from 'antd'; + const TabPane = Tabs.TabPane; class Demo extends React.Component { @@ -37,15 +38,18 @@ class Demo extends React.Component { onChange = (activeKey) => { this.setState({ activeKey }); } + onEdit = (targetKey, action) => { this[action](targetKey); } + add = () => { const panes = this.state.panes; const activeKey = `newTab${this.newTabIndex++}`; panes.push({ title: 'New Tab', content: 'Content of new Tab', key: activeKey }); this.setState({ panes, activeKey }); } + remove = (targetKey) => { let activeKey = this.state.activeKey; let lastIndex; @@ -60,6 +64,7 @@ class Demo extends React.Component { } this.setState({ panes, activeKey }); } + render() { return ( Extra Action; @@ -25,6 +26,6 @@ ReactDOM.render( Content of tab 1 Content of tab 2 Content of tab 3 - -, mountNode); + , + mountNode); ```` diff --git a/components/tabs/demo/icon.md b/components/tabs/demo/icon.md index 2e9073ac55..685597ec33 100644 --- a/components/tabs/demo/icon.md +++ b/components/tabs/demo/icon.md @@ -16,6 +16,7 @@ The Tab with Icon. ````jsx import { Tabs, Icon } from 'antd'; + const TabPane = Tabs.TabPane; ReactDOM.render( @@ -26,6 +27,6 @@ ReactDOM.render( Tab 2} key="2"> Tab 2 - -, mountNode); + , + mountNode); ```` diff --git a/components/tabs/demo/position.md b/components/tabs/demo/position.md index 72f3831079..4913ed7061 100644 --- a/components/tabs/demo/position.md +++ b/components/tabs/demo/position.md @@ -15,6 +15,7 @@ Tab's position: left, right, top or bottom. ````jsx import { Tabs, Select } from 'antd'; + const TabPane = Tabs.TabPane; const Option = Select.Option; @@ -23,9 +24,11 @@ class Demo extends React.Component { state = { tabPosition: 'top', } + changeTabPosition = (tabPosition) => { this.setState({ tabPosition }); } + render() { return (
diff --git a/components/tabs/demo/size.md b/components/tabs/demo/size.md index 763d99098d..b5be97c710 100644 --- a/components/tabs/demo/size.md +++ b/components/tabs/demo/size.md @@ -15,13 +15,16 @@ Large size tabs are usally used in page header, and small size could be used in ````jsx import { Tabs, Radio } from 'antd'; + const { TabPane } = Tabs; class Demo extends React.Component { state = { size: 'small' }; + onChange = (e) => { this.setState({ size: e.target.value }); } + render() { const { size } = this.state; return ( diff --git a/components/tabs/demo/slide.md b/components/tabs/demo/slide.md index e74265ebb4..506afe5d48 100644 --- a/components/tabs/demo/slide.md +++ b/components/tabs/demo/slide.md @@ -15,6 +15,7 @@ In order to fit in more tabs, they can slide left and right (or up and down). ````jsx import { Tabs, Radio } from 'antd'; + const TabPane = Tabs.TabPane; class SlidingTabsDemo extends React.Component { @@ -24,10 +25,12 @@ class SlidingTabsDemo extends React.Component { mode: 'top', }; } + handleModeChange = (e) => { const mode = e.target.value; this.setState({ mode }); } + render() { const { mode } = this.state; return ( diff --git a/components/tag/demo/checkable.md b/components/tag/demo/checkable.md index 30ce86335e..8b481b5c13 100644 --- a/components/tag/demo/checkable.md +++ b/components/tag/demo/checkable.md @@ -19,13 +19,16 @@ title: ````jsx import { Tag } from 'antd'; + const { CheckableTag } = Tag; class MyTag extends React.Component { state = { checked: true }; + handleChange = (checked) => { this.setState({ checked }); } + render() { return ; } @@ -36,6 +39,6 @@ ReactDOM.render( Tag1 Tag2 Tag3 -
-, mountNode); +
, + mountNode); ```` diff --git a/components/tag/demo/colorful.md b/components/tag/demo/colorful.md index b6f68bd447..15bc4f0ae5 100644 --- a/components/tag/demo/colorful.md +++ b/components/tag/demo/colorful.md @@ -40,8 +40,8 @@ ReactDOM.render( #87d068 #108ee9 - -, mountNode); + , + mountNode); ```` ````css diff --git a/components/tag/demo/hot-tags.md b/components/tag/demo/hot-tags.md index 6469e876e3..3e50f4dce6 100644 --- a/components/tag/demo/hot-tags.md +++ b/components/tag/demo/hot-tags.md @@ -15,6 +15,7 @@ Select your favourite topics. ````jsx import { Tag } from 'antd'; + const CheckableTag = Tag.CheckableTag; const tagsFromServer = ['Movies', 'Books', 'Music', 'Sports']; @@ -26,9 +27,9 @@ class HotTags extends React.Component { handleChange(tag, checked) { const { selectedTags } = this.state; - const nextSelectedTags = checked ? - [...selectedTags, tag] : - selectedTags.filter(t => t !== tag); + const nextSelectedTags = checked + ? [...selectedTags, tag] + : selectedTags.filter(t => t !== tag); console.log('You are interested in: ', nextSelectedTags); this.setState({ selectedTags: nextSelectedTags }); } diff --git a/components/time-picker/demo/12hours.md b/components/time-picker/demo/12hours.md index f971624d21..6c914bdd2a 100644 --- a/components/time-picker/demo/12hours.md +++ b/components/time-picker/demo/12hours.md @@ -25,6 +25,6 @@ ReactDOM.render( - -, mountNode); + , + mountNode); ```` diff --git a/components/time-picker/demo/disabled.md b/components/time-picker/demo/disabled.md index 9da9857bfc..4f765f62c8 100644 --- a/components/time-picker/demo/disabled.md +++ b/components/time-picker/demo/disabled.md @@ -19,6 +19,6 @@ import { TimePicker } from 'antd'; import moment from 'moment'; ReactDOM.render( - -, mountNode); + , + mountNode); ```` diff --git a/components/time-picker/demo/hide-column.md b/components/time-picker/demo/hide-column.md index 69595e0cfe..b204231d0c 100644 --- a/components/time-picker/demo/hide-column.md +++ b/components/time-picker/demo/hide-column.md @@ -20,6 +20,6 @@ import moment from 'moment'; const format = 'HH:mm'; ReactDOM.render( - -, mountNode); + , + mountNode); ```` diff --git a/components/time-picker/demo/interval-options.md b/components/time-picker/demo/interval-options.md index 1acff0880b..7ef4d8adfb 100644 --- a/components/time-picker/demo/interval-options.md +++ b/components/time-picker/demo/interval-options.md @@ -16,6 +16,6 @@ Show stepped options by `hourStep` `minuteStep` `secondStep`. import { TimePicker } from 'antd'; ReactDOM.render( - -, mountNode); + , + mountNode); ```` diff --git a/components/time-picker/demo/size.md b/components/time-picker/demo/size.md index 39e1e14a31..cfb39a6aa1 100644 --- a/components/time-picker/demo/size.md +++ b/components/time-picker/demo/size.md @@ -22,6 +22,6 @@ ReactDOM.render( - -, mountNode); + , + mountNode); ```` diff --git a/components/timeline/demo/basic.md b/components/timeline/demo/basic.md index cb5d6b2e7d..0af7e801ec 100644 --- a/components/timeline/demo/basic.md +++ b/components/timeline/demo/basic.md @@ -22,6 +22,6 @@ ReactDOM.render( Solve initial network problems 2015-09-01 Technical testing 2015-09-01 Network problems being solved 2015-09-01 - -, mountNode); + , + mountNode); ```` diff --git a/components/timeline/demo/color.md b/components/timeline/demo/color.md index dd8d2d14f5..1bc8b4db41 100644 --- a/components/timeline/demo/color.md +++ b/components/timeline/demo/color.md @@ -30,6 +30,6 @@ ReactDOM.render(

Technical testing 2

Technical testing 3 2015-09-01

- -, mountNode); + , + mountNode); ```` diff --git a/components/timeline/demo/custom.md b/components/timeline/demo/custom.md index 39b73d9cdb..d2c5f1c736 100644 --- a/components/timeline/demo/custom.md +++ b/components/timeline/demo/custom.md @@ -22,6 +22,6 @@ ReactDOM.render( Solve initial network problems 2015-09-01 } color="red">Technical testing 2015-09-01 Network problems being solved 2015-09-01 - -, mountNode); + , + mountNode); ```` diff --git a/components/tooltip/demo/arrow-point-at-center.md b/components/tooltip/demo/arrow-point-at-center.md index c0fea126b0..9e5acdbbfd 100644 --- a/components/tooltip/demo/arrow-point-at-center.md +++ b/components/tooltip/demo/arrow-point-at-center.md @@ -24,8 +24,8 @@ ReactDOM.render( - -, mountNode); + , + mountNode); ````