ソースを参照

fix TagSelect demo & line-height

nikogu 8 年 前
コミット
7f96f609d8

+ 1 - 1
src/components/TagSelect/demo/expandable.md

@@ -15,7 +15,7 @@ function handleFormSubmit(checkedValue) {
 }
 
 ReactDOM.render(
-  <TagSelect onChange={handleFormSubmit}>
+  <TagSelect onChange={handleFormSubmit} expandable>
     <TagSelect.Option value="cat1">类目一</TagSelect.Option>
     <TagSelect.Option value="cat2">类目二</TagSelect.Option>
     <TagSelect.Option value="cat3">类目三</TagSelect.Option>

+ 3 - 3
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 {
           全部
         </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}`,
             checked: checkedTags.indexOf(child.props.value) > -1,
             onChange: this.handleTagChange,

+ 1 - 0
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 {

+ 1 - 1
src/components/Trend/index.md

@@ -5,7 +5,7 @@ cols: 1
 order: 14
 ---
 
-趋势符号,标记上升和下降状态
+趋势符号,标记上升和下降趋势
 
 ## API