Revert "chore: fix component name for lint"

This reverts commit b900e7c620.
This commit is contained in:
Tim
2025-07-29 11:39:54 +08:00
parent 9255b37533
commit 9f3e5df9ca
2 changed files with 2 additions and 147 deletions

View File

@@ -1,12 +1,5 @@
<template>
<div id="app">
<Popup
v-if="showPopup"
:icon="popupInfo.icon"
:message="popupInfo.message"
:link="popupInfo.link"
@close="showPopup = false"
/>
<HeaderComponent
@toggle-menu="menuVisible = !menuVisible"
:show-menu-btn="!hideMenu"
@@ -27,45 +20,17 @@
<script>
import HeaderComponent from './components/HeaderComponent.vue'
import MenuComponent from './components/MenuComponent.vue'
import Popup from './components/Popup.vue'
import { API_BASE_URL } from './main'
export default {
name: 'App',
components: { HeaderComponent, MenuComponent, Popup },
components: { HeaderComponent, MenuComponent },
data() {
return {
menuVisible: window.innerWidth > 768,
showPopup: false,
popupInfo: {}
}
return { menuVisible: window.innerWidth > 768 }
},
computed: {
hideMenu() {
return ['/login', '/signup', '/404', '/signup-reason', '/github-callback', '/twitter-callback', '/discord-callback', '/forgot-password'].includes(this.$route.path)
}
},
async mounted() {
try {
const res = await fetch(`${API_BASE_URL}/api/activities`)
if (!res.ok) return
const activities = await res.json()
const act = activities.find(a => !a.ended && a.type === 'MILK_TEA')
if (act) {
const key = `activity-popup-${act.id}`
if (!localStorage.getItem(key)) {
this.popupInfo = {
icon: act.icon || 'fas fa-gift',
message: `${act.title} 正在进行中,点击前往活动页面`,
link: '/activities'
}
this.showPopup = true
localStorage.setItem(key, 'shown')
}
}
} catch (e) {
// ignore errors
}
}
}
</script>