Commit c7f705d07195c1b315a14d46b11d382af19505b9

Authored by troy351
Committed by GitHub
1 parent f0de3cc7

add stopPropagation for dropdown

Showing 1 changed file with 5 additions and 0 deletions   Show diff stats
src/components/dropdown/dropdown.vue
@@ -57,6 +57,10 @@ @@ -57,6 +57,10 @@
57 transferClassName: { 57 transferClassName: {
58 type: String 58 type: String
59 }, 59 },
  60 + stopPropagation: {
  61 + type: Boolean,
  62 + default: false
  63 + },
60 }, 64 },
61 computed: { 65 computed: {
62 transition () { 66 transition () {
@@ -164,6 +168,7 @@ @@ -164,6 +168,7 @@
164 }, 168 },
165 mounted () { 169 mounted () {
166 this.$on('on-click', (key) => { 170 this.$on('on-click', (key) => {
  171 + if (this.stopPropagation) return;
167 const $parent = this.hasParent(); 172 const $parent = this.hasParent();
168 if ($parent) $parent.$emit('on-click', key); 173 if ($parent) $parent.$emit('on-click', key);
169 }); 174 });