Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(Sample): update static assets path #4771

Merged
merged 6 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ public async Task<IActionResult> Index([FromServices] IWebHostEnvironment env, [
{
var interval = Random.Shared.Next(1, 2000);
await Task.Delay(interval);
var fileName = Path.Combine(env.WebRootPath, "images/waterfall", $"{id}.jpeg");
#if DEBUG
var fileName = Path.Combine(env.WebRootPath, "../../");
#else
var fileName = Path.Combine(AppContext.BaseDirectory, "_content");
#endif
fileName = Path.Combine(fileName, "BootstrapBlazor.Shared/wwwroot/images/waterfall", $"{id}.jpeg");
return new PhysicalFileResult(fileName, "images/jpeg");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private void OnToggle()
State = !State;
}

private string Value { get; set; }
private string? Value { get; set; }

private IEnumerable<SelectedItem> Items { get; set; } = new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected override void OnInitialized()
{
base.OnInitialized();

_images = Enumerable.Range(1, 100).Select(i => "../../images/default.jpeg").ToList();
_images = Enumerable.Range(1, 100).Select(i => "./_content/BootstrapBlazor.Shared/images/default.jpeg").ToList();
ArgoZhang marked this conversation as resolved.
Show resolved Hide resolved
_items = Enumerable.Range(1, 20).Select(i => $"https://picsum.photos/160/160?random={i}").ToList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Introduction="@Localizer["MouseFollowerIconIntro"]"
Name="MouseFollowerIcon">
<MouseFollower FollowerMode="MouseFollowerMode.Image"
Content="././images/performance.svg">
Content="./_content/BootstrapBlazor.Shared/images/performance.svg">
<div class="mouseFollower-demo" />
</MouseFollower>
</DemoBlock>
Expand All @@ -54,7 +54,7 @@
Name="MouseFollowerImage">
<MouseFollower Options="@FollowerImageOptions"
FollowerMode="MouseFollowerMode.Image"
Content="././images/mousefollower/cat.gif">
Content="./_content/BootstrapBlazor.Shared/images/mousefollower/cat.gif">
<div class="mouseFollower-demo" />
</MouseFollower>
</DemoBlock>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@inject MessageService MessageService
@inject DownloadService DownloadService
@inherits BootstrapModuleComponentBase
@attribute [JSModuleAutoLoader("../../_content/BootstrapBlazor.Shared/Components/Components/Samples/Tutorials/DrawingApp.razor.js")]
@attribute [JSModuleAutoLoader("../../_content/BootstrapBlazor.Shared/Components/Samples/Tutorials/DrawingApp.razor.js")]

<div>
<canvas id="@Id" class="drawing-canvas"></canvas>
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.0.2</Version>
<Version>9.1.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading