Known是基于C#和Blazor开发的前后端分离快速开发框架,开箱即用,跨平台,一处代码,多处运行。
如果对您有帮助,点击⭐Star⭐关注 ,感谢支持开源!
1. 关于系统
2. Host类名变更为AppHost类
//在Main方法中添加
AppHost.RunWebApiAsync<App>(Url);
3. Badge/Tag/Progress组件
3.1. Badge
builder.Badge(style, text);
构建BuildBadge(builder, StyleType.Default, "10");
BuildBadge(builder, StyleType.Primary, "10");
BuildBadge(builder, StyleType.Success, "10");
BuildBadge(builder, StyleType.Info, "10");
BuildBadge(builder, StyleType.Warning, "10");
BuildBadge(builder, StyleType.Danger, "10");
private static void BuildBadge(RenderTreeBuilder builder, StyleType style, string text)
{
builder.Div("demo-badge", attr =>
{
builder.Text("消息中心");
builder.Badge(style, text);
});
}
3.2. Tag
builder.Tag(style, text);
构建BuildTag(builder, StyleType.Default, "测试");
BuildTag(builder, StyleType.Primary, "完成");
BuildTag(builder, StyleType.Success, "通过");
BuildTag(builder, StyleType.Info, "进行中");
BuildTag(builder, StyleType.Warning, "警告");
BuildTag(builder, StyleType.Danger, "失败");
//自定义模板
BuildTag(builder, StyleType.Success, b => b.IconName("fa fa-user", "模板"));
private static void BuildTag(RenderTreeBuilder builder, StyleType style, string text)
{
builder.Div("demo-tag", attr => builder.Tag(style, text));
}
private static void BuildTag(RenderTreeBuilder builder, StyleType style, Action<RenderTreeBuilder> content)
{
builder.Div("demo-tag", attr => builder.Tag(style, content));
}
3.3. Progress
builder.Progress(style, width, value);
构建BuildProgress(builder, StyleType.Default, 0.5M);
BuildProgress(builder, StyleType.Primary, 0.35M);
BuildProgress(builder, StyleType.Success, 1);
BuildProgress(builder, StyleType.Info, 0.6M);
BuildProgress(builder, StyleType.Warning, 0.55M);
BuildProgress(builder, StyleType.Danger, 0.8M);
private static void BuildProgress(RenderTreeBuilder builder, StyleType style, decimal value)
{
builder.Progress(style, 100, value);
}
4. 后台任务
5. 系统附件