update Dropdown

update Dropdown
This commit is contained in:
梁灏 2016-12-04 14:33:06 +08:00
parent 5557dd66f5
commit 6b71ba9418
3 changed files with 63 additions and 11 deletions

View file

@ -37,13 +37,15 @@
methods: {
handleClick () {
const $parent = this.$parent.$parent;
const hasChildren = this.$parent && this.$parent.$options.name === 'Dropdown';
if (this.disabled) {
this.$nextTick(() => {
$parent.visible = true;
});
} else if (hasChildren) {
this.$parent.$emit('on-haschild-click');
} else {
if ($parent.trigger === 'hover') {
$parent.visible = false;
if ($parent && $parent.$options.name === 'Dropdown') {
$parent.$emit('on-hover-click');
}
}