Merge pull request #5489 from troy351/2.0

feature: add stopPropagation for Dropdown
This commit is contained in:
Aresn 2019-04-08 11:09:11 +08:00 committed by GitHub
commit bd56b391ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}); });