diff --git a/src/components/cascader/cascader.vue b/src/components/cascader/cascader.vue
index 7f4d788..9a4c0cc 100644
--- a/src/components/cascader/cascader.vue
+++ b/src/components/cascader/cascader.vue
@@ -29,7 +29,7 @@
:disabled="disabled"
:change-on-select="changeOnSelect"
:trigger="trigger">
-
@@ -113,6 +114,9 @@
filterable: {
type: Boolean,
default: false
+ },
+ notFoundText: {
+ type: String
}
},
data () {
@@ -135,7 +139,8 @@
[`${prefixCls}-show-clear`]: this.showCloseIcon,
[`${prefixCls}-size-${this.size}`]: !!this.size,
[`${prefixCls}-visible`]: this.visible,
- [`${prefixCls}-disabled`]: this.disabled
+ [`${prefixCls}-disabled`]: this.disabled,
+ [`${prefixCls}-not-found`]: this.filterable && this.query !== '' && !this.querySelections.length
}
];
},
@@ -163,6 +168,13 @@
inputPlaceholder () {
return this.filterable && this.currentValue.length ? null : this.localePlaceholder;
},
+ localeNotFoundText () {
+ if (this.notFoundText === undefined) {
+ return this.t('i.select.noMatch');
+ } else {
+ return this.notFoundText;
+ }
+ },
querySelections () {
let selections = [];
function getSelections (arr, label, value) {
diff --git a/src/styles/components/cascader.less b/src/styles/components/cascader.less
index b837a54..6cd2049 100644
--- a/src/styles/components/cascader.less
+++ b/src/styles/components/cascader.less
@@ -79,6 +79,15 @@
padding: 5px 0;
}
+ &-not-found-tip{
+ padding: 5px 0;
+ text-align: center;
+ color: @btn-disable-color;
+ }
+ &-not-found .@{select-dropdown-prefix-cls} {
+ width: 100%;
+ }
+
&-menu{
display: inline-block;
min-width: 100px;
--
libgit2 0.21.4