Merge pull request #3254 from xiaofengsha/pr002
采用 findComponentUpward 替代 this.$parent.$parent.$parent 获取 Dropdown 父节点组件
This commit is contained in:
commit
a1a1e0c73e
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@
|
|||
</template>
|
||||
<script>
|
||||
const prefixCls = 'ivu-dropdown-item';
|
||||
|
||||
import { findComponentUpward } from '../../utils/assist';
|
||||
export default {
|
||||
name: 'DropdownItem',
|
||||
props: {
|
||||
|
@ -37,7 +37,7 @@
|
|||
},
|
||||
methods: {
|
||||
handleClick () {
|
||||
const $parent = this.$parent.$parent.$parent;
|
||||
const $parent = findComponentUpward(this, 'Dropdown');
|
||||
const hasChildren = this.$parent && this.$parent.$options.name === 'Dropdown';
|
||||
|
||||
if (this.disabled) {
|
||||
|
|
Loading…
Add table
Reference in a new issue