refactor(web): migrate to TypeScript + standard Vue3 structure

This commit is contained in:
2026-02-26 12:29:25 +08:00
parent 52f691f02e
commit e2a9ebc7b7
28 changed files with 814 additions and 88 deletions

View File

@@ -18,11 +18,18 @@
</div>
</template>
<script setup>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { getStatistics } from '../services/api'
const stats = ref({})
import type { Stats } from '../services/api'
const stats = ref<Stats>({
total_words: 0,
mastered_words: 0,
need_review: 0,
today_reviewed: 0
})
async function refresh() {
const res = await getStatistics()
stats.value = res.data ?? res