Skip to content

Commit 27f8299

Browse files
authored
doc(OnlineSheet): add OnlineSheet sample code (#5510)
* doc: 增加在线协作示例 * refactor: 增加协作者后台服务 * doc: 增加在线协作示例菜单 * chore: 更新依赖 * doc: 增加分隔栏
1 parent e7156e9 commit 27f8299

17 files changed

+269
-11
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<PackageReference Include="BootstrapBlazor.SummerNote" Version="9.0.3" />
6565
<PackageReference Include="BootstrapBlazor.TableExport" Version="9.2.1" />
6666
<PackageReference Include="BootstrapBlazor.Topology" Version="9.0.0" />
67-
<PackageReference Include="BootstrapBlazor.UniverSheet" Version="9.0.0-beta02" />
67+
<PackageReference Include="BootstrapBlazor.UniverSheet" Version="9.0.0-beta04" />
6868
<PackageReference Include="BootstrapBlazor.VideoPlayer" Version="9.0.3" />
6969
<PackageReference Include="BootstrapBlazor.WinBox" Version="9.0.7" />
7070
</ItemGroup>

src/BootstrapBlazor.Server/Components/Layout/TutorialsLayout.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</div>
1010
<TutorialsNavMenu></TutorialsNavMenu>
1111
<Wwads IsVertical="true"></Wwads>
12+
<LayoutSplitebar Min="220" Max="330" ContainerSelector=".section"></LayoutSplitebar>
1213
</aside>
1314

1415
<section class="main">

src/BootstrapBlazor.Server/Components/Layout/TutorialsLayout.razor.css

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
.section {
2-
--bb-sidebar-width: 0;
3-
}
4-
5-
.main {
1+
.main {
62
padding: 1rem;
73
}
84

@@ -24,7 +20,7 @@
2420

2521
@media (min-width: 768px) {
2622
.section {
27-
--bb-sidebar-width: 300px;
23+
--bb-layout-sidebar-width: 300px;
2824
display: flex;
2925
flex-direction: row;
3026
-webkit-font-smoothing: antialiased;
@@ -35,7 +31,7 @@
3531
}
3632

3733
.sidebar {
38-
width: var(--bb-sidebar-width);
34+
width: var(--bb-layout-sidebar-width);
3935
height: calc(100vh);
4036
position: sticky;
4137
top: 0;
@@ -44,7 +40,8 @@
4440
}
4541

4642
.main {
47-
flex: 1;
43+
flex: 1 1 0%;
44+
min-width: 0px;
4845
height: 100%;
4946
}
5047
}

src/BootstrapBlazor.Server/Components/Layout/TutorialsNavMenu.razor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ protected override async Task OnInitializedAsync()
105105
{
106106
Text = Localizer["AdminSummary"],
107107
Url = "tutorials/admin",
108+
},
109+
new()
110+
{
111+
Text = Localizer["OnlineSheet"],
112+
Url = "tutorials/online-sheet",
108113
}
109114
]);
110115
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@page "/OnlineSheet"
2+
<h3>OnlineSheet</h3>
3+
4+
@code {
5+
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Microsoft.AspNetCore.Components;
2+
3+
namespace BootstrapBlazor.Server.Components.Samples.Tutorials;
4+
5+
public partial class OnlineSheet : ComponentBase
6+
{
7+
}
8+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@namespace BootstrapBlazor.Server.Components.Samples.Tutorials
2+
3+
<div class="bb-contributor">
4+
<img src="@Contributor.Avatar" />
5+
<div class="bb-contributor-main">
6+
<div class="bb-contributor-item">
7+
<label>姓名:</label>
8+
<span>@Contributor.Name</span>
9+
</div>
10+
<div class="bb-contributor-item">
11+
<label>姓名:</label>
12+
<span>@Contributor.Description</span>
13+
</div>
14+
</div>
15+
</div>
16+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License
3+
// See the LICENSE file in the project root for more information.
4+
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
5+
6+
namespace BootstrapBlazor.Server.Components.Samples.Tutorials;
7+
8+
/// <summary>
9+
/// Online sheet sample code
10+
/// </summary>
11+
public partial class OnlineContributor
12+
{
13+
/// <summary>
14+
/// Gets or sets Contributor
15+
/// </summary>
16+
[Parameter]
17+
[NotNull]
18+
public Contributor? Contributor { get; set; }
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.bb-contributor {
2+
display: flex;
3+
flex-direction: row;
4+
}
5+
6+
.bb-contributor img {
7+
border-radius: 50%;
8+
width: 56px;
9+
margin-right: .5rem;
10+
}

0 commit comments

Comments
 (0)