내 티어표 검색 연결
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user