Skip to content

Commit

Permalink
Review address
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Jun 4, 2024
1 parent bc47cf9 commit 1cb98ca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,18 @@ const loading = ref(false)
const filterBy = ref(null)
const sortBy = ref(null)
const homeViewMode = ref(null)
const searchPlaceHolder = ref("anything")
const searchPlaceHolder = ref("search")
onMounted(async () => {
init()
tracker.trackPageView()
})
const getSearchPlaceHolder = computed(() => {
return "search by " + searchPlaceHolder.value
if (currentRoute.value.params.filterBy) {
return "search by " + searchPlaceHolder.value
}
return "search"
})
const init = () => {
Expand Down Expand Up @@ -184,7 +187,7 @@ const makeSearch = () => {
if (item.authorName.toLowerCase().includes(searchVal)) {
searchResultBlog.value.push(item)
}
} else {
} else if (filterBy.value === "title") {
if (item.title.toLowerCase().includes(searchVal)) {
searchResultBlog.value.push(item)
}
Expand Down

0 comments on commit 1cb98ca

Please sign in to comment.