UNPKG

@opentiny/tiny-toolkit-pro

Version:

TinyPro Vue:开箱即用、前后端分离的 Vue 后台管理模板

22 lines (18 loc) 498 B
import { computed } from 'vue'; import { EChartsOption } from 'echarts'; import { useAppStore } from '@/store'; interface optionsFn { (isDark: boolean): any; } export default function useChartOption(sourceOption: optionsFn) { const appStore = useAppStore(); const isDark = computed(() => { return appStore.theme === 'dark'; }); const chartOption = computed<EChartsOption>(() => { return sourceOption(isDark.value); }); return { chartOption, }; }