ElemeFE / ElemeFE/element

[Bug Report] Cascader Component restrict multiple selection

Open
#18,790 3 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Element UI version
2.12.0

### OS/Browsers version
MacOS / Chrome 79.0.3945.130

### Vue version
2.6.10

### Reproduction Link
https://jsfiddle.net/zqt7rk2b/

### Steps to reproduce
I try to restrict multiple for just three item.

I do this by vue's watch , with the data update, the Cascader still can add selection item.

```

var Main = {
data() {
return {
categoryIds: [],
jobCatetoryProps: {
multiple: true,
expandTrigger: "hover",
value: "id",
label: "name",
emitPath: false,
children: "children"
},
jobCategoryOptions: response().data
}
},
watch: {
categoryIds: function(newVal, oldVal) {
// limit 3 items, but not work
if (newVal.length > 3) {
this.categoryIds = oldVal;
}
},
}
}
```

### What is Expected?
the Cascader should restrict multiple selection for three item.

### What is actually happening?
the Cascader still can add selection item.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.