Got the dropdown icon working (finally)
This commit is contained in:
@@ -19,19 +19,25 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
toggle() {
|
toggle() {
|
||||||
this.sharedState.active = !this.sharedState.active
|
this.sharedState.active = !this.sharedState.active
|
||||||
|
},
|
||||||
|
away() {
|
||||||
|
this.sharedState.active = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Icon
|
Icon
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
title: String
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="button" @click="toggle">
|
<div id="button" @click="toggle" v-click-away="away">
|
||||||
<slot name="toggler">
|
<slot name="toggler">
|
||||||
<button>
|
<button>
|
||||||
toggle
|
<p>{{ title }}</p>
|
||||||
<Icon icon="carbon:caret-down" />
|
<Icon icon="carbon:caret-down" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -48,5 +54,12 @@ button {
|
|||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0 10px 0 0px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -54,7 +54,7 @@ export default {
|
|||||||
<option>RRC</option>
|
<option>RRC</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<dropdown>
|
<dropdown title="hello">
|
||||||
<DropdownContent>
|
<DropdownContent>
|
||||||
<DropdownItem>Item 1</DropdownItem>
|
<DropdownItem>Item 1</DropdownItem>
|
||||||
<DropdownItem>Item 2</DropdownItem>
|
<DropdownItem>Item 2</DropdownItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user