refactor(web): migrate to TypeScript + standard Vue3 structure
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user