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';
|
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: 1px solid $color-woot;
|
|
|
|
border-radius: $space-jumbo;
|
|
|
|
float: left;
|
|
|
|
margin: $space-smaller;
|
|
|
|
|
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;
|
2021-02-08 12:57:20 +00:00
|
|
|
color: $color-woot;
|
2020-03-16 06:38:40 +00:00
|
|
|
cursor: pointer;
|
2021-02-08 12:57:20 +00:00
|
|
|
text-align: left;
|
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>
|