英文:
Image not displayed with MudImage
问题
我正在我的Blazor WASM Web应用程序中使用MudBlazor,并尝试像文档中所示添加图像。我的图像位于/Images
文件夹中。我尝试在位于/Shared/Components
的组件中显示图像。
<MudImage Src="/Images/logo_v4_2_190.png" Width="160" Height="190" Alt="MyApp" Elevation="25" Class="rounded-lg" />
我尝试过不带第一个斜杠的路径Images/logo_v4_2_190.png
,但结果相同。我做错了什么?
英文:
I'm using MudBlazor in my Blazor WASM webapp and I'm trying to add an image like they show in the documentation. My image is located in the /Images
folder. The component where I'm trying to show the image is in /Shared/Components
.
<MudImage Src="/Images/logo_v4_2_190.png" Width="160" Height="190" Alt="MyApp" Elevation="25" Class="rounded-lg" />
I've tried to use the path without the first slash Images/logo_v4_2_190.png
and the result is the same. What am I doing wrong?
答案1
得分: 1
在Blazor WebAssembly中,将图片保存在wwwroot文件夹中。
英文:
In Blazor WebAssembly - keep images in the wwwroot folder.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论