ant-design-blazor/components/typography/Title.cs
James Yeung ab3e3c0844
feat(module: typography): refactor & support editable (#3173)
* feat(module: typography): support editable

* fix tests
2023-04-06 23:14:27 +08:00

34 lines
782 B
C#

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Microsoft.AspNetCore.Components;
namespace AntDesign
{
public class Title : TypographyBase
{
protected override string HtmlType => "h" + Level;
private const int DefaultLevel = 1;
private int _level = DefaultLevel;
[Parameter]
public int Level
{
get
{
return _level;
}
set
{
_level = value < 1 || value > 4
? DefaultLevel
: value;
}
}
}
}