LinYeFangHuo/src/packages/components/Tasks/Tasks/TaskRadio/index.vue

58 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div class="go-title-03">
<a-radio-group v-model:value="dataValue" name="radioGroup">
<a-radio v-for="item in dataset" :value="item.value">{{item.label}}</a-radio>
</a-radio-group>
</div>
</template>
<script setup lang="ts">
import { PropType, toRefs } from 'vue'
import { CreateComponentType } from '@/packages/index.d'
import { useChartDataFetch } from '@/hooks';
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
const props = defineProps({
chartConfig: {
type: Object as PropType<CreateComponentType>,
required: true
}
})
const { w, h } = toRefs(props.chartConfig.attr)
const {
colors,
textColor,
textSize,
checkColor,
dataValue,
dataset
} = toRefs(props.chartConfig.option)
// 数据callback处理预览时触发
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: any[]) => {
props.chartConfig.option.dataValue = JSON.stringify(resData);
});
</script>
<style lang="scss" scoped>
@include go('title-03') {
position: relative;
display: flex;
justify-content: center;
align-items: center;
:deep(.ant-radio-wrapper){
color: v-bind('textColor');
font-size: v-bind('textSize+"px"');
margin-right: 20px;
}
:deep(.ant-radio-inner) {
border-color: v-bind('colors[0]');
background: v-bind('colors[1]');
}
:deep( .ant-radio-checked .ant-radio-inner){
background: v-bind('checkColor');
}
}
</style>