platypush/platypush/backend/http/webapp/src/components/elements/DropdownItem.vue

62 lines
940 B
Vue
Raw Normal View History

2020-12-26 15:03:12 +01:00
<template>
2021-07-20 01:35:21 +02:00
<div class="row item" :class="itemClass" @click="clicked">
2021-02-08 02:04:59 +01:00
<div class="col-1 icon" v-if="iconClass">
<i :class="iconClass" />
2020-12-26 15:03:12 +01:00
</div>
2021-02-08 02:04:59 +01:00
<div class="text" :class="{'col-11': iconClass != null}" v-text="text" />
2020-12-26 15:03:12 +01:00
</div>
</template>
<script>
export default {
name: "DropdownItem",
props: {
iconClass: {
type: String,
},
text: {
type: String,
},
disabled: {
type: Boolean,
default: false,
},
2021-07-20 01:35:21 +02:00
itemClass: {
type: String,
}
2020-12-26 15:03:12 +01:00
},
methods: {
clicked(event) {
this.$parent.$emit('click', event)
this.$parent.visible = false
}
}
}
</script>
<style lang="scss" scoped>
.item {
display: flex;
padding: .5em .25em;
cursor: pointer;
align-items: center;
&:hover {
background: $hover-bg;
}
&.disabled {
color: $dropdown-disabled-color;
cursor: initial;
}
.icon {
2022-03-30 01:43:59 +02:00
margin: 0 .5em;
2020-12-26 15:03:12 +01:00
}
}
</style>