config.vue
1.84 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
<template>
<CollapseItem name="配置" :expanded="true">
<SettingItemBox name="标题">
<SettingItem name="内容">
<n-input v-model:value="optionData.dataset" />
</SettingItem>
<SettingItem name="大小">
<n-input-number v-model:value="optionData.attribute.fontSize" />
</SettingItem>
<SettingItem name="x轴位置">
<n-input-number v-model:value="optionData.attribute.fontPos.x" />
</SettingItem>
<SettingItem name="y轴位置">
<n-input-number v-model:value="optionData.attribute.fontPos.y" />
</SettingItem>
<SettingItem name="颜色">
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.attribute.fontColor"></n-color-picker>
</SettingItem>
<SettingItem name="颜色">
<n-button size="small" @click="optionData.attribute.fontColor = '#2AFFFF'"> 恢复默认 </n-button>
</SettingItem>
</SettingItemBox>
<SettingItemBox
:name="`装饰颜色-${index + 1}`"
v-for="(item, index) in optionData.attribute.linearColors"
:key="index"
>
<SettingItem name="颜色">
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="optionData.attribute.linearColors[index]"
></n-color-picker>
</SettingItem>
<SettingItem>
<n-button size="small" @click="optionData.attribute.linearColors[index] = option.attribute.linearColors[index]">
恢复默认
</n-button>
</SettingItem>
</SettingItemBox>
</CollapseItem>
</template>
<script setup lang="ts">
import { PropType } from 'vue'
import { option } from './config'
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
defineProps({
optionData: {
type: Object as PropType<typeof option>,
required: true
}
})
</script>