fix: 修复模块导入路径并移除未使用的 @nuxt/icon 依赖
- 修复 index.vue 中 scoreboard 模块导入路径 - 从 nuxt.config.ts 移除未使用的 @nuxt/icon 模块 - 消除构建时的弃用警告
This commit is contained in:
parent
13d9e2358a
commit
1f55170c6d
@ -95,6 +95,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Trophy, UserFilled, Edit, DataLine } from '@element-plus/icons-vue'
|
import { Trophy, UserFilled, Edit, DataLine } from '@element-plus/icons-vue'
|
||||||
|
import { fetchEvents, fetchTeams, fetchResults } from '~/modules/scoreboard/api'
|
||||||
|
|
||||||
const stats = ref({
|
const stats = ref({
|
||||||
events: 0,
|
events: 0,
|
||||||
@ -106,14 +107,14 @@ const stats = ref({
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const [eventsRes, teamsRes, resultsRes] = await Promise.all([
|
const [eventsRes, teamsRes, resultsRes] = await Promise.all([
|
||||||
$fetch('/api/events'),
|
fetchEvents(),
|
||||||
$fetch('/api/teams'),
|
fetchTeams(),
|
||||||
$fetch('/api/results')
|
fetchResults()
|
||||||
])
|
])
|
||||||
|
|
||||||
stats.value.events = eventsRes.data?.length || 0
|
stats.value.events = eventsRes?.length || 0
|
||||||
stats.value.teams = teamsRes.data?.length || 0
|
stats.value.teams = teamsRes?.length || 0
|
||||||
stats.value.results = resultsRes.data?.length || 0
|
stats.value.results = resultsRes?.length || 0
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to load stats:', error)
|
console.error('Failed to load stats:', error)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ export default defineNuxtConfig({
|
|||||||
|
|
||||||
modules: [
|
modules: [
|
||||||
'@nuxt/eslint',
|
'@nuxt/eslint',
|
||||||
'@nuxt/icon',
|
|
||||||
'@pinia/nuxt',
|
'@pinia/nuxt',
|
||||||
'@element-plus/nuxt'
|
'@element-plus/nuxt'
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user