refactor(projects): 代码优化

ISSUES CLOSED: \
This commit is contained in:
Soybean
2022-05-31 00:26:52 +08:00
parent 6a5a357f50
commit d9ac7e4de0
6 changed files with 201 additions and 38 deletions

View File

@@ -31,13 +31,8 @@
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { useThemeStore } from '@/store';
import { useEcharts, type ECOption } from '@/hooks';
const theme = useThemeStore();
const darkMode = computed(() => theme.darkMode);
import { ref } from 'vue';
import { useEcharts, type ECOption } from '@/composables';
const lineOptions = ref<ECOption>({
tooltip: {
@@ -133,7 +128,7 @@ const lineOptions = ref<ECOption>({
}
]
});
const { domRef: lineRef } = useEcharts(lineOptions, darkMode);
const { domRef: lineRef } = useEcharts(lineOptions);
const pieOptions = ref<ECOption>({
tooltip: {
@@ -180,7 +175,7 @@ const pieOptions = ref<ECOption>({
}
]
});
const { domRef: pieRef } = useEcharts(pieOptions, darkMode);
const { domRef: pieRef } = useEcharts(pieOptions);
</script>
<style scoped></style>