UnisKB/ui/src/components/app-charts/index.vue

31 lines
563 B
Vue
Raw Normal View History

2024-03-29 07:45:04 +00:00
<template>
<component
:is="typeComponentMap[type]"
:height="height"
:option="option"
:dataZoom="dataZoom"
class="v-charts"
/>
</template>
<script lang="ts" setup>
import line from './components/LineCharts.vue'
defineOptions({ name: 'AppCharts' })
defineProps({
type: {
type: String,
default: 'line'
},
height: {
type: String,
default: '200px'
},
dataZoom: Boolean,
option: {
type: Object,
required: true
2024-04-15 10:46:03 +00:00
} // { title , xData, yData, formatStr }
2024-03-29 07:45:04 +00:00
})
const typeComponentMap = { line } as any
</script>