sectionView-modal.vue
2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<template>
<section class="trimedit">
<div class="trimedit-types">
<span
:class="selecteditem === item.key ? 'item selected' : 'item'"
v-for="item in items"
:key="item.key"
@click="onSelect(item.key)"
>
<img :src="item.image" />
<div class="text" v-text="$t(item.key)" />
</span>
</div>
</section>
</template>
<script setup>
import { useTrimEditStore } from '@/views/stores/funtional-toolbar/useTrimEditStore';
import { storeToRefs } from 'pinia';
const store = useTrimEditStore();
const { items, selecteditem } = storeToRefs(store);
const { setSelectedItem } = store;
const onSelect = (key) => {
setSelectedItem(key);
};
</script>
<style lang="less" scoped>
.trimedit {
display: flex;
flex-direction: column;
gap: 8px;
margin-top: 20px;
.trimedit-types {
display: flex;
flex-direction: row;
-webkit-box-pack: justify;
justify-content: space-between;
.item {
box-sizing: border-box;
display: flex;
cursor: pointer;
background-color: #ffffff;
padding: 8px 11px;
border: 1px solid #cdd1d5;
border-radius: 8px;
border-image: initial;
display: flex;
flex-direction: column;
width: 140px;
img {
width: 36px;
height: 36px;
margin: auto;
display: block;
}
.text {
width: max-content;
padding-top: 5px;
margin: 0px;
font-size: 14px;
line-height: 22px;
font-weight: 500;
color: #333333;
margin: auto;
display: block;
font-weight: 600;
}
&.selected {
background-color: @color-button-selected-background;
border-color: @color-button-main-selected-border;
}
&:hover {
background-color: @color-button-hover-background;
}
}
}
.button-big {
display: flex;
width: 100%;
-webkit-box-pack: center;
justify-content: center;
-webkit-box-align: center;
align-items: center;
padding: 0px;
height: 46px;
border-radius: 8px;
cursor: pointer;
margin: 0px;
font-size: 14px;
line-height: 20px;
font-weight: 600;
margin-top: 12px;
}
}
</style>