Commit 7f96f609 authored by nikogu's avatar nikogu

fix TagSelect demo & line-height

parent df6ecfb4
...@@ -15,7 +15,7 @@ function handleFormSubmit(checkedValue) { ...@@ -15,7 +15,7 @@ function handleFormSubmit(checkedValue) {
} }
ReactDOM.render( ReactDOM.render(
<TagSelect onChange={handleFormSubmit}> <TagSelect onChange={handleFormSubmit} expandable>
<TagSelect.Option value="cat1">类目一</TagSelect.Option> <TagSelect.Option value="cat1">类目一</TagSelect.Option>
<TagSelect.Option value="cat2">类目二</TagSelect.Option> <TagSelect.Option value="cat2">类目二</TagSelect.Option>
<TagSelect.Option value="cat3">类目三</TagSelect.Option> <TagSelect.Option value="cat3">类目三</TagSelect.Option>
......
import React, { PureComponent } from 'react'; import React, { Component } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { Tag, Icon } from 'antd'; import { Tag, Icon } from 'antd';
...@@ -19,7 +19,7 @@ TagSelectOption.defaultProps = { ...@@ -19,7 +19,7 @@ TagSelectOption.defaultProps = {
displayName: 'TagSelectOption', displayName: 'TagSelectOption',
}; };
class TagSelect extends PureComponent { class TagSelect extends Component {
static defaultProps = { static defaultProps = {
initialValue: [], initialValue: [],
}; };
...@@ -103,7 +103,7 @@ class TagSelect extends PureComponent { ...@@ -103,7 +103,7 @@ class TagSelect extends PureComponent {
全部 全部
</CheckableTag> </CheckableTag>
{ {
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}`, key: `tag-select-${child.props.value}`,
checked: checkedTags.indexOf(child.props.value) > -1, checked: checkedTags.indexOf(child.props.value) > -1,
onChange: this.handleTagChange, onChange: this.handleTagChange,
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
max-height: 32px; max-height: 32px;
line-height: 32px;
transition: all .3s; transition: all .3s;
:global { :global {
.ant-tag { .ant-tag {
......
...@@ -5,7 +5,7 @@ cols: 1 ...@@ -5,7 +5,7 @@ cols: 1
order: 14 order: 14
--- ---
趋势符号,标记上升和下降状态 趋势符号,标记上升和下降趋势
## API ## API
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment