【发布时间】:2021-11-07 21:46:09
【问题描述】:
我确信这是因为我已经盯着这个看了几个小时,然后我错过了一些愚蠢的东西。我正在尝试提取相关用户名的头像。 :alt="user.name" 工作正常,但头像不行。
我正在使用 Laravel 和 Jetstream 来完成这项工作。我有它在其他地方工作,但不是在这里。我做错了什么?
<td class="px-2 py-2 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" :src="user.profile_photo_url" :alt="user.name" />
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900 dark:text-gray-100">
{{ user.name }}
</div>
<div class="text-sm text-gray-500 dark:text-gray-100">
User Location
</div>
</div>
</div>
</td>
和脚本信息
<script>
import {DotsVerticalIcon, BanIcon, AtSymbolIcon, UserAddIcon, HashtagIcon, UserCircleIcon, ExclamationIcon, ShieldCheckIcon} from '@heroicons/vue/outline';
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue';
import UserProfileSlideout from './UserProfileSlideout.vue';
export default {
components: {
DotsVerticalIcon,
Menu,
MenuButton,
MenuItem,
MenuItems,
BanIcon,
AtSymbolIcon,
UserAddIcon,
HashtagIcon,
UserCircleIcon,
ExclamationIcon,
ShieldCheckIcon,
UserProfileSlideout,
},
data: function () {
return {
showUserProfileSlideout: false,
}
},
name: 'UserListItem',
props: ['user'],
methods: {
showUserProfile() {
this.showUserProfileSlideout = !this.showUserProfileSlideout;
},
}
}
</script>
【问题讨论】:
-
您是否在 Jetstream 中启用了个人资料照片?
-
是的,我做到了。它正在其他组件中工作
标签: laravel vue.js inertiajs jetstream