Merge pull request #5489 from troy351/2.0
feature: add stopPropagation for Dropdown
This commit is contained in:
commit
bd56b391ea
1 changed files with 5 additions and 0 deletions
|
@ -57,6 +57,10 @@
|
||||||
transferClassName: {
|
transferClassName: {
|
||||||
type: String
|
type: String
|
||||||
},
|
},
|
||||||
|
stopPropagation: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
transition () {
|
transition () {
|
||||||
|
@ -164,6 +168,7 @@
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.$on('on-click', (key) => {
|
this.$on('on-click', (key) => {
|
||||||
|
if (this.stopPropagation) return;
|
||||||
const $parent = this.hasParent();
|
const $parent = this.hasParent();
|
||||||
if ($parent) $parent.$emit('on-click', key);
|
if ($parent) $parent.$emit('on-click', key);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue