From f09c8d5d05dffdc83ed25823886566f87e8f1656 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 9 Jul 2024 14:30:24 +0800 Subject: [PATCH] fix(Topology): missing background cause value is null (#3822) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 增加 null 忽略标签 * chore: bump version 8.0.8 --- .../BootstrapBlazor.Topology/BootstrapBlazor.Topology.csproj | 2 +- .../Components/Topology/TopologyItem.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Extensions/Components/BootstrapBlazor.Topology/BootstrapBlazor.Topology.csproj b/src/Extensions/Components/BootstrapBlazor.Topology/BootstrapBlazor.Topology.csproj index 6cb9d4f04..14dfa656f 100644 --- a/src/Extensions/Components/BootstrapBlazor.Topology/BootstrapBlazor.Topology.csproj +++ b/src/Extensions/Components/BootstrapBlazor.Topology/BootstrapBlazor.Topology.csproj @@ -1,7 +1,7 @@ - 8.0.7 + 8.0.8 diff --git a/src/Extensions/Components/BootstrapBlazor.Topology/Components/Topology/TopologyItem.cs b/src/Extensions/Components/BootstrapBlazor.Topology/Components/Topology/TopologyItem.cs index f89967af5..ae3c7eb95 100644 --- a/src/Extensions/Components/BootstrapBlazor.Topology/Components/Topology/TopologyItem.cs +++ b/src/Extensions/Components/BootstrapBlazor.Topology/Components/Topology/TopologyItem.cs @@ -2,6 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ +using System.Text.Json.Serialization; + namespace BootstrapBlazor.Components; /// @@ -22,6 +24,7 @@ public class TopologyItem /// /// 获得/设置 显示文字 /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Text { get; set; } /// @@ -32,11 +35,13 @@ public class TopologyItem /// /// 获得/设置 显示文字颜色 /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? TextColor { get; set; } /// /// 获得/设置 背景颜色 /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Background { get; set; } ///