Skip to content

Commit 562146f

Browse files
committed
doc: 更新文档
1 parent 8913083 commit 562146f

File tree

4 files changed

+17
-24
lines changed

4 files changed

+17
-24
lines changed

src/BootstrapBlazor.Server/Components/Samples/MindMaps.razor

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
</HeadContent>
77

88
<h3>@Localizer["MindMapTitle"]</h3>
9-
109
<h4>@Localizer["MindMapDescription"]</h4>
1110

1211
<PackageTips Name="BootstrapBlazor.MindMap" />
1312

13+
<p><code>MindMap</code> 是对 <code>Javascript</code> <a href="https://github.com/wanglin2/mind-map?wt.mc_id=DT-MVP-5004174">MindMap</a> 仓库的封装,使其更加符合 <code>Blazor</code> 使用习惯</p>
14+
<p class="code-label">1. 画图</p>
15+
<p>通过 <a href="https://wanglin2.github.io/mind-map/#/">在线工具地址</a> 绘制或者导入进行修改后导出 <code>Json</code> 格式数据</p>
16+
<div class="code-label">2. 对组件 <code>Data</code> 参数赋值即可呈现</div>
17+
1418
<DemoBlock Title="@Localizer["MindMapNormalTitle"]" Introduction="@Localizer["MindMapDescription"]" Name="MindMapNormal">
1519
<section ignore>
1620
<div class="row g-3 form-inline">
@@ -22,12 +26,12 @@
2226
</div>
2327
</div>
2428
</section>
25-
<MindMap Layout="_layout" Theme="_theme" Data="@_data" @ref="MindMap"></MindMap>
29+
<MindMap Layout="_layout" Theme="_theme" Data="@SampleData1" @ref="MindMap"></MindMap>
2630
<section ignore>
2731
<div class="row g-3 mt-3">
2832
<div class="col-12">
29-
<Button Text="@Localizer["Sample1ButtonText"]" OnClick="Sample1"></Button>
30-
<Button Text="@Localizer["Sample2ButtonText"]" OnClick="Sample2"></Button>
33+
<Button Text="@Localizer["Sample1ButtonText"]" OnClick="SetSample1"></Button>
34+
<Button Text="@Localizer["Sample2ButtonText"]" OnClick="SetSample2"></Button>
3135
<Button Text="@Localizer["ExportButtonText"]" OnClick="ExportImage"></Button>
3236
<Button Text="@Localizer["ExportJsonButtonText"]" OnClick="ExportJson"></Button>
3337
<Button Text="@Localizer["GetFullDataButtonText"]" OnClick="GetFullData"></Button>

src/BootstrapBlazor.Server/Components/Samples/MindMaps.razor.cs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,16 @@ public partial class MindMaps
2323
[NotNull]
2424
private MindMap? MindMap { get; set; }
2525

26-
/// <summary>
27-
/// 初始化数据
28-
/// </summary>
29-
public string _data = SampleData1;
30-
3126
async Task ExportImage()
3227
{
3328
await MindMap.Export();
34-
await ShowBottomMessage("下载Png");
29+
await ShowBottomMessage("下载 Png");
3530
}
3631

3732
async Task ExportJson()
3833
{
3934
await MindMap.Export("json", withConfig: false);
40-
await ShowBottomMessage("下载Json");
41-
}
42-
43-
async Task ExportPng()
44-
{
45-
await MindMap.Export(download: false, withConfig: false);
46-
await ShowBottomMessage("已导出Png");
35+
await ShowBottomMessage("下载 Json");
4736
}
4837

4938
private Task ShowBottomMessage(string message) => MessageService.Show(new MessageOption()
@@ -59,7 +48,7 @@ async Task GetFullData()
5948

6049
async Task GetData()
6150
{
62-
_result = await MindMap.GetData(false);
51+
_result = await MindMap.GetData();
6352
}
6453

6554
async Task SetData()
@@ -83,13 +72,13 @@ async Task Scale(float step)
8372
await MindMap.Scale(_scale);
8473
}
8574

86-
async Task Sample1()
75+
async Task SetSample1()
8776
{
8877
_result = SampleData1;
8978
await SetData();
9079
}
9180

92-
async Task Sample2()
81+
async Task SetSample2()
9382
{
9483
_result = SampleData2;
9584
await SetData();

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6306,7 +6306,7 @@
63066306
},
63076307
"BootstrapBlazor.Server.Components.Samples.MindMaps": {
63086308
"MindMapTitle": "Mind Map",
6309-
"MindMapDescription": "The shortcut key tab adds a new node, the mouse can drag node arrangement",
6309+
"MindMapDescription": "Used to display specific Json format data as a Web mind map",
63106310
"MindMapNormalTitle": "Basic usage",
63116311
"MindMapLayout": "Layout",
63126312
"MindMapTheme": "Theme",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6306,12 +6306,12 @@
63066306
},
63076307
"BootstrapBlazor.Server.Components.Samples.MindMaps": {
63086308
"MindMapTitle": "Mind Map 思维导图",
6309-
"MindMapDescription": "快捷键Tab添加新节点,鼠标可拖动节点排列",
6309+
"MindMapDescription": "用于将特定 Json 格式数据展示成 Web 思维导图",
63106310
"MindMapNormalTitle": "基本用法",
63116311
"MindMapLayout": "布局",
63126312
"MindMapTheme": "主题",
6313-
"Sample1ButtonText": "例子1",
6314-
"Sample2ButtonText": "一周安排",
6313+
"Sample1ButtonText": "普通示例",
6314+
"Sample2ButtonText": "周安排示例",
63156315
"ExportButtonText": "导出 PNG",
63166316
"ExportJsonButtonText": "导出 Json",
63176317
"GetFullDataButtonText": "GetFullData",

0 commit comments

Comments
 (0)