fixed #721
This commit is contained in:
parent
8409abb815
commit
cb6418ac5e
3 changed files with 60 additions and 21 deletions
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<Checkbox-group v-model="fruit">
|
||||
<Checkbox v-for="item in tags" :label="item.label"></Checkbox>
|
||||
<Checkbox v-for="item in tags" :label="item.label" :key="item"></Checkbox>
|
||||
</Checkbox-group>
|
||||
<div>{{ fruit }}</div>
|
||||
</div>
|
||||
|
|
|
@ -1,25 +1,63 @@
|
|||
<!--<template>-->
|
||||
<!--<Row>-->
|
||||
<!--<i-col span="8">-->
|
||||
<!--<Card>-->
|
||||
<!--<Dropdown @on-click="handleClick">-->
|
||||
<!--<a href="javascript:void(0)">-->
|
||||
<!--下拉菜单-->
|
||||
<!--<Icon type="arrow-down-b"></Icon>-->
|
||||
<!--</a>-->
|
||||
<!--<Dropdown-menu slot="list">-->
|
||||
<!--<Dropdown-item name="1">驴打滚</Dropdown-item>-->
|
||||
<!--<Dropdown-item name="2">炸酱面</Dropdown-item>-->
|
||||
<!--<Dropdown-item name="3" disabled>豆汁儿</Dropdown-item>-->
|
||||
<!--<Dropdown-item name="4">冰糖葫芦</Dropdown-item>-->
|
||||
<!--<Dropdown-item name="5" divided>北京烤鸭</Dropdown-item>-->
|
||||
<!--</Dropdown-menu>-->
|
||||
<!--</Dropdown>-->
|
||||
<!--</Card>-->
|
||||
<!--</i-col>-->
|
||||
<!--</Row>-->
|
||||
<!--</template>-->
|
||||
<!--<script>-->
|
||||
<!--export default {-->
|
||||
<!--methods: {-->
|
||||
<!--handleClick (val) {-->
|
||||
<!--console.log(val)-->
|
||||
<!--}-->
|
||||
<!--}-->
|
||||
<!--}-->
|
||||
<!--</script>-->
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Dropdown @on-click="handleClick">
|
||||
<a href="javascript:void(0)">
|
||||
下拉菜单
|
||||
<Icon type="arrow-down-b"></Icon>
|
||||
</a>
|
||||
<Dropdown-menu slot="list">
|
||||
<Dropdown-item name="1">驴打滚</Dropdown-item>
|
||||
<Dropdown-item name="2">炸酱面</Dropdown-item>
|
||||
<Dropdown-item name="3" disabled>豆汁儿</Dropdown-item>
|
||||
<Dropdown-item name="4">冰糖葫芦</Dropdown-item>
|
||||
<Dropdown-item name="5" divided>北京烤鸭</Dropdown-item>
|
||||
</Dropdown-menu>
|
||||
</Dropdown>
|
||||
</div>
|
||||
<Table border :context="self" :columns="columns7" :data="data6"></Table>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
self: this,
|
||||
columns7: [
|
||||
{
|
||||
title: '姓名',
|
||||
key: 'name',
|
||||
render (row, column, index) {
|
||||
return `<Dropdown @on-click="change"><a href="javascript:void(0)">下拉菜单<Icon type="arrow-down-b"></Icon></a><Dropdown-menu slot="list"><Dropdown-item name="1">驴打滚</Dropdown-item><Dropdown-item name="2">炸酱面</Dropdown-item><Dropdown-item disabled name="3">豆汁儿</Dropdown-item><Dropdown-item>冰糖葫芦</Dropdown-item><Dropdown-item divided>北京烤鸭</Dropdown-item></Dropdown-menu></Dropdown>`;
|
||||
}
|
||||
}
|
||||
],
|
||||
data6: [
|
||||
{
|
||||
name: '王小明',
|
||||
age: 18,
|
||||
address: '北京市朝阳区芍药居'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick (val) {
|
||||
console.log(val)
|
||||
change (s) {
|
||||
console.log(s)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<script>
|
||||
import Drop from '../select/dropdown.vue';
|
||||
import clickoutside from '../../directives/clickoutside';
|
||||
import { oneOf } from '../../utils/assist';
|
||||
import { oneOf, findComponentUpward } from '../../utils/assist';
|
||||
|
||||
const prefixCls = 'ivu-dropdown';
|
||||
|
||||
|
@ -99,8 +99,9 @@
|
|||
this.currentVisible = false;
|
||||
},
|
||||
hasParent () {
|
||||
const $parent = this.$parent.$parent.$parent;
|
||||
if ($parent && $parent.$options.name === 'Dropdown') {
|
||||
// const $parent = this.$parent.$parent.$parent;
|
||||
const $parent = findComponentUpward(this, 'Dropdown');
|
||||
if ($parent) {
|
||||
return $parent;
|
||||
} else {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue