Skip to content

Commit b9869e9

Browse files
authored
doc(Sample): update static assets path (#4771)
* refactor: 增加可为空标识 * refactor: 更改路径 * refactor: 更新文档图片资源路径 * refactor: 更新画笔应用资源路径 * refactor: 瀑布流 api 支持部署与开发环境 * chore: bump version 9.1.0
1 parent e9a7076 commit b9869e9

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

src/BootstrapBlazor.Server/Controllers/WaterfallController.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ public async Task<IActionResult> Index([FromServices] IWebHostEnvironment env, [
2222
{
2323
var interval = Random.Shared.Next(1, 2000);
2424
await Task.Delay(interval);
25-
var fileName = Path.Combine(env.WebRootPath, "images/waterfall", $"{id}.jpeg");
25+
#if DEBUG
26+
var fileName = Path.Combine(env.WebRootPath, "../../");
27+
#else
28+
var fileName = Path.Combine(AppContext.BaseDirectory, "_content");
29+
#endif
30+
fileName = Path.Combine(fileName, "BootstrapBlazor.Shared/wwwroot/images/waterfall", $"{id}.jpeg");
2631
return new PhysicalFileResult(fileName, "images/jpeg");
2732
}
2833
}

src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private void OnToggle()
2626
State = !State;
2727
}
2828

29-
private string Value { get; set; }
29+
private string? Value { get; set; }
3030

3131
private IEnumerable<SelectedItem> Items { get; set; } = new[]
3232
{

src/BootstrapBlazor.Shared/Components/Samples/IntersectionObservers.razor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected override void OnInitialized()
2323
{
2424
base.OnInitialized();
2525

26-
_images = Enumerable.Range(1, 100).Select(i => "../../images/default.jpeg").ToList();
26+
_images = Enumerable.Range(1, 100).Select(i => "./_content/BootstrapBlazor.Shared/images/default.jpeg").ToList();
2727
_items = Enumerable.Range(1, 20).Select(i => $"https://picsum.photos/160/160?random={i}").ToList();
2828
}
2929

src/BootstrapBlazor.Shared/Components/Samples/MouseFollowers.razor

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
Introduction="@Localizer["MouseFollowerIconIntro"]"
4545
Name="MouseFollowerIcon">
4646
<MouseFollower FollowerMode="MouseFollowerMode.Image"
47-
Content="././images/performance.svg">
47+
Content="./_content/BootstrapBlazor.Shared/images/performance.svg">
4848
<div class="mouseFollower-demo" />
4949
</MouseFollower>
5050
</DemoBlock>
@@ -54,7 +54,7 @@
5454
Name="MouseFollowerImage">
5555
<MouseFollower Options="@FollowerImageOptions"
5656
FollowerMode="MouseFollowerMode.Image"
57-
Content="././images/mousefollower/cat.gif">
57+
Content="./_content/BootstrapBlazor.Shared/images/mousefollower/cat.gif">
5858
<div class="mouseFollower-demo" />
5959
</MouseFollower>
6060
</DemoBlock>

src/BootstrapBlazor.Shared/Components/Samples/Tutorials/DrawingApp.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@inject MessageService MessageService
33
@inject DownloadService DownloadService
44
@inherits BootstrapModuleComponentBase
5-
@attribute [JSModuleAutoLoader("../../_content/BootstrapBlazor.Shared/Components/Components/Samples/Tutorials/DrawingApp.razor.js")]
5+
@attribute [JSModuleAutoLoader("../../_content/BootstrapBlazor.Shared/Components/Samples/Tutorials/DrawingApp.razor.js")]
66

77
<div>
88
<canvas id="@Id" class="drawing-canvas"></canvas>

src/BootstrapBlazor/BootstrapBlazor.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.0.2</Version>
4+
<Version>9.1.0</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

0 commit comments

Comments
 (0)