내 티어표 검색 연결

This commit is contained in:
2026-04-07 14:43:05 +09:00
parent ede348be96
commit bc5a34bbb7
7 changed files with 22 additions and 3 deletions

View File

@@ -604,7 +604,7 @@ function handleLeftRailSearch() {
function submitGlobalSearch() {
const query = (searchQuery.value || '').trim()
isCollapsedSearchOpen.value = false
if (['home', 'templates', 'topicHub', 'followingFeed', 'favorites'].includes(String(route.name || ''))) {
if (['home', 'templates', 'topicHub', 'followingFeed', 'favorites', 'me'].includes(String(route.name || ''))) {
const nextQuery = { ...route.query }
if (query) nextQuery.q = query
else delete nextQuery.q

View File

@@ -14,6 +14,14 @@ const myLists = ref([])
const error = ref('')
const brokenThumbnailIds = ref({})
const isListView = computed(() => route.query.view === 'list')
const query = computed(() => (typeof route.query.q === 'string' ? route.query.q.trim().toLowerCase() : ''))
const filteredMyLists = computed(() => {
if (!query.value) return myLists.value
return myLists.value.filter((tierList) => {
const haystack = `${tierList.title || ''} ${tierList.topicName || ''} ${tierList.authorName || ''}`.toLowerCase()
return haystack.includes(query.value)
})
})
watch(error, (message) => {
if (!message) return
@@ -78,8 +86,9 @@ function openList(t) {
<section class="panel">
<div v-if="myLists.length === 0" class="empty">아직 저장한 티어표가 없어요.</div>
<div v-else-if="filteredMyLists.length === 0" class="empty">검색어에 맞는 티어표가 없어요.</div>
<div v-else class="list" :class="{ 'list--table': isListView }">
<article v-for="t in myLists" :key="t.id" class="boardCard" :class="{ 'boardCard--list': isListView }">
<article v-for="t in filteredMyLists" :key="t.id" class="boardCard" :class="{ 'boardCard--list': isListView }">
<button class="boardCard__body" :class="{ 'boardCard__body--list': isListView }" @click="openList(t)">
<div class="boardCard__thumbWrap">
<img