2020-03-16 06:38:40 +00:00
|
|
|
<template>
|
2021-02-08 12:57:20 +00:00
|
|
|
<li
|
|
|
|
class="option"
|
|
|
|
:class="{ 'is-selected': isSelected }"
|
|
|
|
:style="{ borderColor: widgetColor }"
|
|
|
|
>
|
2020-03-16 06:38:40 +00:00
|
|
|
<button class="option-button button" @click="onClick">
|
2021-02-08 12:57:20 +00:00
|
|
|
<span :style="{ color: widgetColor }">{{ action.title }}</span>
|
2020-03-16 06:38:40 +00:00
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-02-08 12:57:20 +00:00
|
|
|
import { mapGetters } from 'vuex';
|
2022-04-01 15:29:03 +00:00
|
|
|
|
2020-03-16 06:38:40 +00:00
|
|
|
export default {
|
|
|
|
components: {},
|
|
|
|
props: {
|
|
|
|
action: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {},
|
|
|
|
},
|
|
|
|
isSelected: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
2021-02-08 12:57:20 +00:00
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
widgetColor: 'appConfig/getWidgetColor',
|
|
|
|
}),
|
|
|
|
},
|
2020-03-16 06:38:40 +00:00
|
|
|
methods: {
|
|
|
|
onClick() {
|
2020-04-10 11:12:37 +00:00
|
|
|
this.$emit('click', this.action);
|
2020-03-16 06:38:40 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2021-02-08 12:57:20 +00:00
|
|
|
@import '~widget/assets/scss/variables.scss';
|
|
|
|
|
2020-03-16 06:38:40 +00:00
|
|
|
.option {
|
2021-02-08 12:57:20 +00:00
|
|
|
border-radius: $space-jumbo;
|
2021-09-19 15:42:54 +00:00
|
|
|
border: 1px solid $color-woot;
|
2021-02-08 12:57:20 +00:00
|
|
|
float: left;
|
|
|
|
margin: $space-smaller;
|
2021-09-19 15:42:54 +00:00
|
|
|
max-width: 100%;
|
2021-02-08 12:57:20 +00:00
|
|
|
|
2020-03-16 06:38:40 +00:00
|
|
|
.option-button {
|
|
|
|
background: transparent;
|
2021-02-08 12:57:20 +00:00
|
|
|
border-radius: $space-large;
|
2020-03-16 06:38:40 +00:00
|
|
|
border: 0;
|
|
|
|
cursor: pointer;
|
2021-09-19 15:42:54 +00:00
|
|
|
height: auto;
|
|
|
|
line-height: 1.5;
|
|
|
|
min-height: $space-two * 2;
|
2021-02-08 12:57:20 +00:00
|
|
|
text-align: left;
|
2021-09-19 15:42:54 +00:00
|
|
|
white-space: normal;
|
2020-03-16 06:38:40 +00:00
|
|
|
|
|
|
|
span {
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .icon {
|
|
|
|
margin-right: $space-smaller;
|
|
|
|
font-size: $font-size-medium;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|