Skip to content

Commit

Permalink
fix: use new import for default image instead of require
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyxguo committed Jul 17, 2023
1 parent 667e1df commit 6d1b078
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
13 changes: 3 additions & 10 deletions src/views/Archives.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@
<h1 class="post-title text-white uppercase">{{ t('menu.archives') }}</h1>
</div>
<div
class="
bg-ob-deep-800
px-14
py-16
rounded-2xl
shadow-xl
block
min-h-screen
"
class="bg-ob-deep-800 px-14 py-16 rounded-2xl shadow-xl block min-h-screen"
>
<ul class="timeline timeline-centered">
<template
Expand Down Expand Up @@ -70,6 +62,7 @@ import { useI18n } from 'vue-i18n'
import Breadcrumbs from '@/components/Breadcrumbs.vue'
import Paginator from '@/components/Paginator.vue'
import { useCommonStore } from '@/stores/common'
import defaultCover from '@/assets/default-cover.jpg'
export default defineComponent({
name: 'Archives',
Expand All @@ -89,7 +82,7 @@ export default defineComponent({
pagination.value.pageTotal = data.total
archives.value = data.data
})
commonStore.setHeaderImage(`${require('@/assets/default-cover.jpg')}`)
commonStore.setHeaderImage(defaultCover)
}
const pageChangeHanlder = (page: number) => {
Expand Down
3 changes: 2 additions & 1 deletion src/views/Tag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { useTagStore } from '@/stores/tag'
import { TagList, TagItem } from '@/components/Tag'
import { useCommonStore } from '@/stores/common'
import SvgIcon from '@/components/SvgIcon/index.vue'
import defaultCover from '@/assets/default-cover.jpg'
export default defineComponent({
name: 'Tag',
Expand All @@ -49,7 +50,7 @@ export default defineComponent({
const fetchData = async () => {
tagStore.fetchAllTags()
commonStore.setHeaderImage(`${require('@/assets/default-cover.jpg')}`)
commonStore.setHeaderImage(defaultCover)
}
onBeforeMount(fetchData)
Expand Down

0 comments on commit 6d1b078

Please sign in to comment.