Skip to content

Commit c58902b

Browse files
committed
refactor: 增加 GetTargets 方法
1 parent 2b30076 commit c58902b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/BootstrapBlazor.Server/Data/WebsiteOptions.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
@@ -130,6 +130,11 @@ public class WebsiteOptions
130130
[NotNull]
131131
public HashSet<ThemeOption>? Themes { get; set; }
132132

133+
/// <summary>
134+
/// 获得/设置 目标框架集合
135+
/// </summary>
136+
public List<string> TargetFrameworks { get; set; } = [];
137+
133138
/// <summary>
134139
/// 构造函数
135140
/// </summary>
@@ -174,4 +179,11 @@ public string GetAssetUrl(string url)
174179
/// <param name="id"></param>
175180
/// <returns></returns>
176181
public string GetAvatarUrl(int id) => $"{AssetRootPath}images/avatars/150-{Math.Max(1, id % 25)}.jpg";
182+
183+
/// <summary>
184+
/// 获得目标框架字符串
185+
/// </summary>
186+
/// <param name="separator"></param>
187+
/// <returns></returns>
188+
public string GetTargets(string separator = "/") => string.Join(separator, TargetFrameworks);
177189
}

0 commit comments

Comments
 (0)