| 1234567891011121314151617181920212223242526272829 |
- import { reactive } from 'vue'
- import { EchartsDataset } from './interface'
- export function useDataset() {
- const dataset = reactive<EchartsDataset>({
- line: {
- dimensions: ['date', 'price'],
- source: {
- date: [],
- price: [],
- },
- },
- yAxisMin: (value) => value.min,
- yAxisMax: (value) => value.max,
- })
- // 清空数据
- const clearData = () => {
- dataset.line.source = {
- date: [],
- price: [],
- };
- }
- return {
- dataset,
- clearData,
- }
- }
|