Skip to content

Commit a6a7e5e

Browse files
committed
test / get assets file path
1 parent da9cd85 commit a6a7e5e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/ui/components/namecard/Namecard24.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import NamecardAvatar from './NamecardAvatar24.vue'
33
import type { NamecardUser } from '@vuejs-jp/model'
44
import { useUserRole } from '@vuejs-jp/composable'
5+
import { onMounted, ref } from 'vue'
56
67
type NamecardProps = {
78
user: NamecardUser
@@ -11,6 +12,10 @@ type NamecardProps = {
1112
defineProps<NamecardProps>()
1213
1314
const { backgroundColor } = useUserRole()
15+
const sponsorImagePath = ref('')
16+
onMounted(() => {
17+
sponsorImagePath.value = new URL('../../assets/namecard/support.svg', import.meta.url).href
18+
})
1419
</script>
1520

1621
<template>
@@ -23,7 +28,7 @@ const { backgroundColor } = useUserRole()
2328
{{ user.role }}
2429
</div>
2530
<div class="namecard-sponsor">
26-
<img src="../../assets/namecard/support.svg" alt="Supported by Stockmark" />
31+
<img :src="sponsorImagePath" alt="Supported by Stockmark" />
2732
</div>
2833
</div>
2934
</template>

packages/ui/components/namecard/NamecardAvatar24.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import NamecardAvatarLogo from './NamecardAvatarLogo24.vue'
33
import type { NamecardUser } from '@vuejs-jp/model'
4+
import { onMounted, ref } from 'vue'
45
56
type NamecardAvatarProps = {
67
user: NamecardUser
@@ -12,13 +13,17 @@ const COLOR_AVATAR_NAME = {
1213
DEFAULT: 'color-mix(in srgb, var(--color-vue-blue), #000 20%)',
1314
PLACEHOLDER: 'var(--color-gray100)',
1415
}
16+
const vuefesLogoImagePath = ref('')
17+
onMounted(() => {
18+
vuefesLogoImagePath.value = new URL('../../assets/namecard/vuefes_logo.svg', import.meta.url).href
19+
})
1520
</script>
1621

1722
<template>
1823
<div class="avatar">
1924
<span class="avatar-hook" aria-hidden="true" />
2025
<div class="vuefes-logo-wrapper">
21-
<img src="../../assets/namecard/vuefes_logo.svg" alt="vuefes logo" />
26+
<img :src="vuefesLogoImagePath" alt="vuefes logo" />
2227
</div>
2328
<div class="avatar-logo-wrapper">
2429
<NamecardAvatarLogo :user="user" />

0 commit comments

Comments
 (0)