mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-05 13:39:39 +08:00
!3676 doc(#I67D47): update sample for FileViewers
* doc(#I67D47): FileViewers 例子美化路径,css 添加 border
This commit is contained in:
parent
9983883146
commit
c78023f4eb
@ -12,18 +12,18 @@
|
||||
|
||||
<DemoBlock Title="@Localizer["BaseUsageText"]" Introduction="@Localizer["BaseUsageIntro"]" Name="Nomal">
|
||||
<p><h5>Word</h5></p>
|
||||
<FileViewer Filename="@WordSampleFile" Height="500px" />
|
||||
<FileViewer Filename="@WordSampleFile" Height="300px" StyleString="padding: var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);border: var(--bs-card-border-width) solid var(--bs-card-border-color);" />
|
||||
<br />
|
||||
<p><h5>Excel</h5></p>
|
||||
<FileViewer Filename="@ExcelSampleFile" Height="500px" />
|
||||
<FileViewer Filename="@ExcelSampleFile" Height="300px" StyleString="padding: var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);border: var(--bs-card-border-width) solid var(--bs-card-border-color);" />
|
||||
</DemoBlock>
|
||||
|
||||
<DemoBlock Title="@Localizer["BaseUsageText2"]" Introduction="@Localizer["BaseUsageIntro2"]" Name="Nomal">
|
||||
<div class="row g-3">
|
||||
<div class="col-6 col-sm-4 col-md-3 col-xl-1">
|
||||
<div class="col-6 col-sm-4 col-md-3 col-xl-2">
|
||||
<Dropdown TValue="string" Items="Items" OnSelectedItemChanged="@ChangeURL" />
|
||||
</div>
|
||||
<div class="col-6 col-sm-4 col-md-3 col-xl-8">
|
||||
<div class="col-6 col-sm-4 col-md-3 col-xl-5">
|
||||
<BootstrapInput @bind-Value="@Url" />
|
||||
</div>
|
||||
<div class="col-6 col-sm-4 col-md-3 col-xl-auto">
|
||||
@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FileViewer @ref="fileViewer" Filename=@Url Height="500px" />
|
||||
<FileViewer @ref="fileViewer" Filename=@Url Height="300px" StyleString="padding: var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);border: var(--bs-card-border-width) solid var(--bs-card-border-color);" />
|
||||
</DemoBlock>
|
||||
|
||||
<AttributeTable Items="@GetAttributes()" />
|
||||
|
@ -40,14 +40,14 @@ public partial class FileViewers
|
||||
WordSampleFile = CombineFilename("sample.docx");
|
||||
ExcelSampleFile = CombineFilename("sample.xlsx");
|
||||
|
||||
FileList.Add(CombineFilename("sample3.xlsx"));
|
||||
FileList.Add(CombineFilename("sample2.xlsx"));
|
||||
FileList.Add(CombineFilename("sample.xlsx"));
|
||||
FileList.Add(CombineFilename("sample2.docx"));
|
||||
FileList.Add(CombineFilename("sample.docx"));
|
||||
Url = FileList[0];
|
||||
FileList.Add("sample3.xlsx");
|
||||
FileList.Add("sample2.xlsx");
|
||||
FileList.Add("sample.xlsx");
|
||||
FileList.Add("sample2.docx");
|
||||
FileList.Add("sample.docx");
|
||||
Url = CombineFilename(FileList[0]);
|
||||
|
||||
Items = FileList.Select(i => new SelectedItem(i, $"File{i}")).ToList();
|
||||
Items = FileList.Select(i => new SelectedItem(i, i)).ToList();
|
||||
}
|
||||
|
||||
private string CombineFilename(string filename)
|
||||
@ -64,7 +64,7 @@ public partial class FileViewers
|
||||
{
|
||||
Url = e.Value;
|
||||
StateHasChanged();
|
||||
await fileViewer.Reload(e.Value);
|
||||
await fileViewer.Reload(CombineFilename(e.Value));
|
||||
}
|
||||
|
||||
private async Task Apply()
|
||||
|
Loading…
Reference in New Issue
Block a user