Image not displayed with MudImage

huangapple go评论80阅读模式
英文:

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.

&lt;MudImage Src=&quot;/Images/logo_v4_2_190.png&quot; Width=&quot;160&quot; Height=&quot;190&quot; Alt=&quot;MyApp&quot; Elevation=&quot;25&quot; Class=&quot;rounded-lg&quot; /&gt;

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.

huangapple
  • 本文由 发表于 2023年6月19日 03:31:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76502231.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定