feat: 新增进度条多个配置项

This commit is contained in:
奔跑的面条
2022-06-25 15:51:38 +08:00
parent 3eac0d1592
commit 012eed6f67
3 changed files with 84 additions and 28 deletions
@@ -1,27 +1,53 @@
<template>
<n-progress
:type="type"
:height="h"
:processing="processing"
:percentage="dataset"
:indicator-placement="indicatorPlacement"
:color="color"
/>
:rail-color="railColor"
:offset-degree="offsetDegree"
>
<n-text
:style="{
color: indicatorTextColor,
fontSize: `${indicatorTextSize}px`
}"
>
{{dataset}} {{unit}}
</n-text>
</n-progress>
</template>
<script setup lang="ts">
import { PropType, toRefs, watch } from 'vue'
import { useChartDataFetch } from '@/hooks'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import config from './config'
import config from './config'
const props = defineProps({
chartConfig: {
type: Object as PropType<config>,
required: true,
},
required: true
}
})
// 取配置数据
const { type, color, indicatorPlacement, dataset } = toRefs(props.chartConfig.option)
const { w, h } = toRefs(props.chartConfig.attr)
const {
type,
unit,
color,
fontSize,
processing,
railColor,
indicatorTextColor,
indicatorPlacement,
indicatorTextSize,
offsetDegree,
dataset
} = toRefs(props.chartConfig.option)
useChartDataFetch(props.chartConfig, useChartEditStore)
</script>
</script>