support Dropdown

support Dropdown
This commit is contained in:
梁灏 2017-03-03 17:46:09 +08:00
parent 1c803cdfb0
commit b1c118d85e
10 changed files with 91 additions and 48 deletions

View file

@ -5,8 +5,9 @@
const prefixCls = 'ivu-dropdown-item';
export default {
name: 'DropdownItem',
props: {
key: {
name: {
type: [String, Number]
},
disabled: {
@ -36,7 +37,7 @@
},
methods: {
handleClick () {
const $parent = this.$parent.$parent;
const $parent = this.$parent.$parent.$parent;
const hasChildren = this.$parent && this.$parent.$options.name === 'Dropdown';
if (this.disabled) {
@ -50,7 +51,7 @@
$parent.$emit('on-hover-click');
}
}
$parent.$emit('on-click', this.key);
$parent.$emit('on-click', this.name);
}
}
};