diff --git a/CHANGE.md b/CHANGE.md index a6caf9f1..ab869d7b 100644 --- a/CHANGE.md +++ b/CHANGE.md @@ -1,3 +1,5 @@ +### Button +可以考虑是否支持 @click,而不用 @click.native ### Input 使用 v-model ### RadioGroup diff --git a/src/components/dropdown/dropdown-item.vue b/src/components/dropdown/dropdown-item.vue index 463dce11..0bd902c0 100644 --- a/src/components/dropdown/dropdown-item.vue +++ b/src/components/dropdown/dropdown-item.vue @@ -42,7 +42,7 @@ if (this.disabled) { this.$nextTick(() => { - $parent.visible = true; + $parent.currentVisible = true; }); } else if (hasChildren) { this.$parent.$emit('on-haschild-click'); diff --git a/src/components/dropdown/dropdown.vue b/src/components/dropdown/dropdown.vue index db972b43..280f9923 100644 --- a/src/components/dropdown/dropdown.vue +++ b/src/components/dropdown/dropdown.vue @@ -99,7 +99,7 @@ this.currentVisible = false; }, hasParent () { - const $parent = this.$parent.$parent; + const $parent = this.$parent.$parent.$parent; if ($parent && $parent.$options.name === 'Dropdown') { return $parent; } else { @@ -135,35 +135,6 @@ const $parent = this.hasParent(); if ($parent) $parent.$emit('on-haschild-click'); }); - }, -// events: { -// 'on-click' (key) { -// const $parent = this.hasParent(); -// if ($parent ) $parent.$emit('on-click', key); -// }, -// 'on-hover-click' () { -// const $parent = this.hasParent(); -// if ($parent) { -// this.$nextTick(() => { -// if (this.trigger === 'custom') return false; -// this.currentVisible = false; -// }); -// $parent.$emit('on-hover-click'); -// } else { -// this.$nextTick(() => { -// if (this.trigger === 'custom') return false; -// this.currentVisible = false; -// }); -// } -// }, -// 'on-haschild-click' () { -// this.$nextTick(() => { -// if (this.trigger === 'custom') return false; -// this.currentVisible = true; -// }); -// const $parent = this.hasParent(); -// if ($parent) $parent.$emit('on-haschild-click'); -// } -// } + } }; diff --git a/src/styles/components/dropdown.less b/src/styles/components/dropdown.less index d70f0963..3bc27155 100644 --- a/src/styles/components/dropdown.less +++ b/src/styles/components/dropdown.less @@ -14,7 +14,7 @@ } &-rel{ - display: inline-block; + //display: inline-block; position: relative; } diff --git a/test/routers/dropdown.vue b/test/routers/dropdown.vue index 00466278..52d76856 100644 --- a/test/routers/dropdown.vue +++ b/test/routers/dropdown.vue @@ -1,26 +1,32 @@