import { reactive } from 'vue' import { EchartsDataset } from './interface' export function useDataset() { const dataset = reactive({ 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, } }