代码格式化: prettier --write 统一代码风格

39 个文件按 .prettierrc.json (printWidth 100 / no semi / singleQuote) 统一格式, 纯空白与换行调整, 无逻辑变更。为接入代码门禁做准备, 让 npm run check (format:check + lint:strict + typecheck) 干净通过。
This commit is contained in:
yml
2026-06-14 16:24:01 +08:00
parent ae4297fec7
commit f410be3797
39 changed files with 87 additions and 80 deletions
@@ -88,9 +88,7 @@ function readItems(key: string): ListingCollectionItem[] {
if (!raw) return []
const parsed = JSON.parse(raw) as unknown
if (!Array.isArray(parsed)) return []
return parsed
.map(normalizeItem)
.filter((item): item is ListingCollectionItem => Boolean(item))
return parsed.map(normalizeItem).filter((item): item is ListingCollectionItem => Boolean(item))
} catch {
localStorage.removeItem(key)
return []
@@ -30,8 +30,12 @@ const {
} = useListingCollections()
const activeTab = ref(route.query.tab === 'favorites' ? 'favorites' : 'history')
const isMobilePage = computed(() => route.path.startsWith('/m/'))
const activeItems = computed(() => (activeTab.value === 'favorites' ? favorites.value : history.value))
const emptyText = computed(() => (activeTab.value === 'favorites' ? '暂无收藏账号' : '暂无浏览记录'))
const activeItems = computed(() =>
activeTab.value === 'favorites' ? favorites.value : history.value
)
const emptyText = computed(() =>
activeTab.value === 'favorites' ? '暂无收藏账号' : '暂无浏览记录'
)
async function handleClearHistory() {
try {
@@ -81,13 +85,21 @@ function timeText(item: ListingCollectionItem) {
<h1>我的足迹</h1>
<p>找回看过和收藏过的账号</p>
</div>
<button v-if="activeTab === 'history' && history.length" type="button" @click="handleClearHistory">
<button
v-if="activeTab === 'history' && history.length"
type="button"
@click="handleClearHistory"
>
清空记录
</button>
</header>
<nav class="collection-tabs">
<button :class="{ active: activeTab === 'history' }" type="button" @click="activeTab = 'history'">
<button
:class="{ active: activeTab === 'history' }"
type="button"
@click="activeTab = 'history'"
>
浏览记录 <span>{{ history.length }}</span>
</button>
<button
@@ -291,7 +291,6 @@ function updateAgreementReadState(type: 'virtual' | 'renter') {
}
}
// 手动锁定/解锁背景滚动
watch(agreementVisible, visible => {
// 只锁定 .pc-main 容器,不影响 body 和 sticky 导航栏
@@ -513,7 +512,11 @@ function handleToggleFavorite() {
>
{{ listing.in_transaction ? '交易中' : '立即下单' }}
</el-button>
<el-button class="full-control favorite-order-btn" size="large" @click="handleToggleFavorite">
<el-button
class="full-control favorite-order-btn"
size="large"
@click="handleToggleFavorite"
>
{{ listingFavorited ? '取消收藏' : '收藏账号' }}
</el-button>
</el-form>