chore: 添加设计资料和示例工程
This commit is contained in:
36
sample/front/src/components/chart/index.vue
Normal file
36
sample/front/src/components/chart/index.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<VChart
|
||||
v-if="renderChart"
|
||||
:option="option"
|
||||
autoresize
|
||||
:style="{ width, height }"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { EChartsOption } from 'echarts';
|
||||
import { nextTick, ref } from 'vue';
|
||||
import VChart from 'vue-echarts';
|
||||
|
||||
defineProps({
|
||||
option: {
|
||||
type: Object as () => EChartsOption,
|
||||
default: () => ({}),
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%',
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '100%',
|
||||
},
|
||||
});
|
||||
|
||||
const renderChart = ref(false);
|
||||
nextTick(() => {
|
||||
renderChart.value = true;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
Reference in New Issue
Block a user