Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>11.0.0-rc.2.1</Version>
</PropertyGroup>

<PropertyGroup>
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Icon</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>11.0.0-rc.2.1</Version>
</PropertyGroup>

<PropertyGroup>
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Office Viewer Word Excel PowerPoint Pdf Csv Text</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ namespace BootstrapBlazor.Components;
[JSModuleAutoLoader("./_content/BootstrapBlazor.JitViewer/Components/JitViewer.razor.js", JSObjectReference = true)]
public partial class JitViewer
{
private const string StylePath = "_content/BootstrapBlazor.JitViewer/jit-viewer.css";

#if NET9_0_OR_GREATER
private string StyleUrl => Assets[StylePath];
#else
private static string StyleUrl => StylePath;
#endif

/// <summary>
/// <para lang="zh">预览文件路径</para>
/// <para lang="en">File path for preview</para>
Expand Down Expand Up @@ -90,7 +98,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
/// <inheritdoc/>
/// </summary>
/// <returns></returns>
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, GetOptions());
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, GetOptions(), StyleUrl);

private object GetOptions() => new
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { addLink, addScript, getTheme } from '../../BootstrapBlazor/modules/util
import Data from '../../BootstrapBlazor/modules/data.js'
import EventHandler from "../../BootstrapBlazor/modules/event-handler.js"

export async function init(id, invoke, options) {
await addLink('./_content/BootstrapBlazor.JitViewer/jit-viewer.css');
export async function init(id, invoke, options, styleUrl) {
await addLink(styleUrl)
await addScript('./_content/BootstrapBlazor.JitViewer/lib/jit-viewer.min.js');

const el = document.getElementById(id);
Expand Down
Loading