Skip to content

Commit 0ddbd77

Browse files
committed
feat: 增加 PageIndex
1 parent 6fbacbc commit 0ddbd77

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,22 @@
1616
<Switch @bind-Value="@_useGoogleDocs"></Switch>
1717
</BootstrapInputGroup>
1818
</div>
19+
<div class="col-12 col-sm-6">
20+
<BootstrapInputGroup>
21+
<BootstrapInputGroupLabel DisplayText="PageIndex"></BootstrapInputGroupLabel>
22+
<Select @bind-Value="@_pageIndex">
23+
<Options>
24+
<SelectOption Value="1" Text="1"></SelectOption>
25+
<SelectOption Value="3" Text="3"></SelectOption>
26+
<SelectOption Value="5" Text="5"></SelectOption>
27+
<SelectOption Value="10" Text="10"></SelectOption>
28+
</Options>
29+
</Select>
30+
</BootstrapInputGroup>
31+
</div>
1932
</div>
2033
</section>
21-
<PdfViewer Url="./samples/sample.pdf" Height="620px"
34+
<PdfViewer Url="./samples/sample.pdf" Height="620px" PageIndex="@_pageIndex"
2235
NotSupportCallback="NotSupportCallback" OnLoaded="OnLoaded"
2336
UseGoogleDocs="@_useGoogleDocs"></PdfViewer>
2437
</DemoBlock>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public partial class PdfViewers
1717

1818
private bool _useGoogleDocs = false;
1919

20+
private int _pageIndex = 1;
21+
2022
private Task OnLoaded() => ToastService.Success("Pdf Viewer", Localizer["PdfViewerToastSuccessfulContent"]);
2123

2224
private Task NotSupportCallback() => ToastService.Error("PdfViewer", Localizer["PdfViewerToastNotSupportContent"]);

0 commit comments

Comments
 (0)