SettingItemBox.vue
1.02 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
<template>
<div class="go-config-item-box">
<n-text class="item-left" depth="2">
{{ name }}
<n-space :size="5">
<slot name="name"></slot>
</n-space>
</n-text>
<div
class="item-right"
:style="{
gridTemplateColumns: alone ? '1fr' : '1fr 1fr',
...itemRightStyle
}"
>
<slot></slot>
</div>
</div>
</template>
<script setup lang="ts">
defineProps({
name: {
type: String,
required: false
},
alone: {
type: Boolean,
default: false,
required: false
},
itemRightStyle: {
type: Object,
default: () => {},
required: false
}
})
</script>
<style lang="scss" scoped>
$leftWidth: 60px;
@include go('config-item-box') {
position: relative;
display: flex;
margin: 20px 0;
.item-left {
width: $leftWidth;
text-align: left;
margin-top: 4px;
margin-left: 10px;
font-size: 12px;
}
.item-right {
display: grid;
grid-column-gap: 10px;
width: calc(100% - #{$leftWidth});
}
}
</style>