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,9 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

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

<PropertyGroup>
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components</PackageTags>
<Description>Bootstrap UI components extensions of Grantt</Description>
Expand Down
10 changes: 9 additions & 1 deletion src/components/BootstrapBlazor.Gantt/Components/Gantt.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ namespace BootstrapBlazor.Components;
/// </summary>
public partial class Gantt
{
private const string StylePath = "_content/BootstrapBlazor.Gantt/css/gantt.bundle.css";

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

/// <summary>
/// 获得或设置 甘特图数据源
/// </summary>
Expand Down Expand Up @@ -62,7 +70,7 @@ protected override void OnParametersSet()
/// <summary>
/// <inheritdoc/>
/// </summary>
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Items, Option, Interop);
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Items, Option, Interop, StyleUrl);

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import { addLink } from '../../BootstrapBlazor/modules/utility.js'
import Data from '../../BootstrapBlazor/modules/data.js'

export async function init(id, tasks, option, invoke) {
export async function init(id, tasks, option, invoke, styleUrl) {
const el = document.getElementById(id)
if (el === null) {
return
}

await addLink("./_content/BootstrapBlazor.Gantt/css/gantt.bundle.css")
await addLink(styleUrl)

const gantt = new Gantt(el, tasks, {
on_click: function (task) {
Expand Down
Loading