From 7f96f609d891ef1cfe1cbb677802ff270f6b0de7 Mon Sep 17 00:00:00 2001 From: nikogu <644506165@qq.com> Date: Tue, 31 Oct 2017 13:47:56 +0800 Subject: [PATCH] fix TagSelect demo & line-height --- src/components/TagSelect/demo/expandable.md | 2 +- src/components/TagSelect/index.js | 6 +++--- src/components/TagSelect/index.less | 1 + src/components/Trend/index.md | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/TagSelect/demo/expandable.md b/src/components/TagSelect/demo/expandable.md index 72df4e82..34f804a3 100644 --- a/src/components/TagSelect/demo/expandable.md +++ b/src/components/TagSelect/demo/expandable.md @@ -15,7 +15,7 @@ function handleFormSubmit(checkedValue) { } ReactDOM.render( - + 类目一 类目二 类目三 diff --git a/src/components/TagSelect/index.js b/src/components/TagSelect/index.js index 62017143..498f33c9 100644 --- a/src/components/TagSelect/index.js +++ b/src/components/TagSelect/index.js @@ -1,4 +1,4 @@ -import React, { PureComponent } from 'react'; +import React, { Component } from 'react'; import classNames from 'classnames'; import { Tag, Icon } from 'antd'; @@ -19,7 +19,7 @@ TagSelectOption.defaultProps = { displayName: 'TagSelectOption', }; -class TagSelect extends PureComponent { +class TagSelect extends Component { static defaultProps = { initialValue: [], }; @@ -103,7 +103,7 @@ class TagSelect extends PureComponent { 全部 { - children.filter(child => child.props.displayName === 'TagSelectOption').map(child => React.cloneElement(child, { + checkedTags && children.filter(child => child.props.displayName === 'TagSelectOption').map(child => React.cloneElement(child, { key: `tag-select-${child.props.value}`, checked: checkedTags.indexOf(child.props.value) > -1, onChange: this.handleTagChange, diff --git a/src/components/TagSelect/index.less b/src/components/TagSelect/index.less index ae1941fb..7311cd88 100644 --- a/src/components/TagSelect/index.less +++ b/src/components/TagSelect/index.less @@ -7,6 +7,7 @@ position: relative; overflow: hidden; max-height: 32px; + line-height: 32px; transition: all .3s; :global { .ant-tag { diff --git a/src/components/Trend/index.md b/src/components/Trend/index.md index 7948bf43..ea861203 100644 --- a/src/components/Trend/index.md +++ b/src/components/Trend/index.md @@ -5,7 +5,7 @@ cols: 1 order: 14 --- -趋势符号,标记上升和下降状态。 +趋势符号,标记上升和下降趋势。 ## API -- GitLab