Skip to content

Commit 7ffb16c

Browse files
committed
refactor: 移除内置样式
1 parent 50e04e0 commit 7ffb16c

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/BootstrapBlazor/Components/Button/ExportPdfButton.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ public class ExportPdfButton : Button
6767
[Inject, NotNull]
6868
private IHtml2Pdf? Html2PdfService { get; set; }
6969

70-
[Inject, NotNull]
71-
private NavigationManager? NavigationManager { get; set; }
72-
7370
[Inject, NotNull]
7471
private DownloadService? DownloadService { get; set; }
7572

@@ -117,21 +114,8 @@ protected override async Task HandlerClick()
117114
</html>
118115
""";
119116

120-
// 增加网页所需样式表文件
121-
List<string> styles = [
122-
$"{NavigationManager.BaseUri}_content/BootstrapBlazor.FontAwesome/css/font-awesome.min.css",
123-
$"{NavigationManager.BaseUri}_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css"
124-
];
125-
if (StyleTags != null)
126-
{
127-
styles.AddRange(StyleTags);
128-
}
129-
130-
// 增加网页所需脚本文件
131-
var scripts = ScriptTags ?? [];
132-
133117
// 生成 Pdf 流
134-
using var stream = await Html2PdfService.PdfStreamFromHtmlAsync(htmlString, styles, scripts);
118+
using var stream = await Html2PdfService.PdfStreamFromHtmlAsync(htmlString, StyleTags, ScriptTags);
135119

136120
if (OnBeforeDownload != null)
137121
{

0 commit comments

Comments
 (0)