update Dropdown
update Dropdown
This commit is contained in:
parent
ab8aaf958a
commit
79633f3c02
4 changed files with 30 additions and 26 deletions
BIN
assets/iview.png
BIN
assets/iview.png
Binary file not shown.
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 163 KiB |
|
@ -41,7 +41,9 @@
|
||||||
this.$parent.$parent.visible = true;
|
this.$parent.$parent.visible = true;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$parent.$parent.visible = false;
|
if (this.$parent.$parent.trigger === 'hover') {
|
||||||
|
this.$parent.$parent.visible = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$parent.$parent.$emit('on-click', this.key);
|
this.$parent.$parent.$emit('on-click', this.key);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,10 @@
|
||||||
content: '';
|
content: '';
|
||||||
height: 5px;
|
height: 5px;
|
||||||
display: block;
|
display: block;
|
||||||
margin: -7px -16px 0;
|
margin: 0 -16px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
position: relative;
|
||||||
|
top: -7px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,33 +1,33 @@
|
||||||
<style>
|
|
||||||
body{
|
|
||||||
padding: 50px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<template>
|
<template>
|
||||||
<Dropdown trigger="click" align="right" @on-click="click">
|
<Dropdown>
|
||||||
<i-button type="primary">
|
<a href="javascript:void(0)">
|
||||||
下拉菜单
|
hover 触发
|
||||||
<Icon type="arrow-down-b"></Icon>
|
<Icon type="arrow-down-b"></Icon>
|
||||||
</i-button>
|
</a>
|
||||||
<Dropdown-menu slot="list">
|
<Dropdown-menu slot="list">
|
||||||
<Dropdown-item>张三</Dropdown-item>
|
<Dropdown-item>驴打滚</Dropdown-item>
|
||||||
<Dropdown-item disabled>李四</Dropdown-item>
|
<Dropdown-item>炸酱面</Dropdown-item>
|
||||||
<Dropdown-item>王五</Dropdown-item>
|
<Dropdown-item>豆汁儿</Dropdown-item>
|
||||||
<Dropdown-item divided>周六</Dropdown-item>
|
<Dropdown-item>冰糖葫芦</Dropdown-item>
|
||||||
|
<Dropdown-item>北京烤鸭</Dropdown-item>
|
||||||
|
</Dropdown-menu>
|
||||||
|
</Dropdown>
|
||||||
|
<Dropdown trigger="click" style="margin-left: 20px">
|
||||||
|
<a href="javascript:void(0)">
|
||||||
|
click 触发
|
||||||
|
<Icon type="arrow-down-b"></Icon>
|
||||||
|
</a>
|
||||||
|
<Dropdown-menu slot="list">
|
||||||
|
<Dropdown-item>驴打滚</Dropdown-item>
|
||||||
|
<Dropdown-item>炸酱面</Dropdown-item>
|
||||||
|
<Dropdown-item>豆汁儿</Dropdown-item>
|
||||||
|
<Dropdown-item>冰糖葫芦</Dropdown-item>
|
||||||
|
<Dropdown-item>北京烤鸭</Dropdown-item>
|
||||||
</Dropdown-menu>
|
</Dropdown-menu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {},
|
|
||||||
data () {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
methods: {
|
|
||||||
click (key) {
|
|
||||||
console.log(key)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue