| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <template>
- <div class="go-text-box">
- <n-gradient-text :size="size" :gradient="gradient">
- {{ option.dataset }}
- </n-gradient-text>
- </div>
- </template>
- <script setup lang="ts">
- import { PropType, toRefs, shallowReactive, watch } 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 option = shallowReactive({
- dataset: ''
- })
- const { w, h } = toRefs(props.chartConfig.attr)
- const { size, gradient } = toRefs(props.chartConfig.option)
- watch(
- () => props.chartConfig.option.dataset,
- (newData: any) => {
- option.dataset = newData
- }, {
- immediate: true
- }
- )
- useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => {
- option.dataset = newData
- })
- </script>
- <style lang="scss" scoped>
- @include go('text-box') {
- display: flex;
- align-items: center;
- justify-content: center;
- .n-gradient-text {
- white-space: initial;
- }
- }
- </style>
|