Skip to content

Commit 4caee17

Browse files
committed
feat: Showsummary on multiple select
1 parent 9d7a28a commit 4caee17

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "element-react-ui-components",
3-
"version": "1.1.25",
3+
"version": "1.1.27",
44
"description": "Element UI components for React",
55
"private": false,
66
"main": "dist/npm/es5/index.js",
@@ -74,6 +74,7 @@
7474
"sinon": "^4.0.2",
7575
"style-loader": "^0.19.0",
7676
"typescript": "2.7.2",
77+
"tslint-checker":"2.0.2",
7778
"url-loader": "^0.6.2",
7879
"webpack": "^3.8.1",
7980
"webpack-dev-server": "^2.9.4"

src/select/Select.jsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ class Select extends Component {
817817
}
818818

819819
render() {
820-
const { multiple, size, disabled, filterable, loading } = this.props;
820+
const { multiple, size, disabled, filterable, loading, summaryView } = this.props;
821821
const { selected, inputWidth, inputLength, query, selectedLabel, visible, options, filteredOptionsCount, currentPlaceholder } = this.state;
822822

823823
return (
@@ -827,7 +827,7 @@ class Select extends Component {
827827
<div ref="tags" className="el-select__tags" onClick={this.toggleMenu.bind(this)} style={{
828828
maxWidth: inputWidth - 32
829829
}}>
830-
{selected.length > 1
830+
{selected.length > 1 && summaryView
831831
? <Tag
832832
type="primary"
833833
key={selected.length}
@@ -983,6 +983,7 @@ Select.propTypes = {
983983
remoteMethod: PropTypes.func,
984984
filterMethod: PropTypes.func,
985985
multiple: PropTypes.bool,
986+
summaryView: PropTypes.bool,
986987
placeholder: PropTypes.string,
987988
onChange: PropTypes.func,
988989
onVisibleChange: PropTypes.func,

typings/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ declare namespace ElementReact {
818818
remoteMethod?(): void
819819
filterMethod?(): void
820820
multiple?: boolean
821+
summaryView?: boolean
821822
placeholder?: string
822823
onChange?(value?): void
823824
onVisibleChange?(visible?: boolean): void,

0 commit comments

Comments
 (0)