mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-14 21:52:56 +08:00
21 lines
596 B
Python
21 lines
596 B
Python
|
|
from typing import Literal
|
||
|
|
|
||
|
|
from ...models.components.divider import Divider
|
||
|
|
from ..base import BaseBuilder
|
||
|
|
|
||
|
|
|
||
|
|
class DividerBuilder(BaseBuilder[Divider]):
|
||
|
|
"""链式构建分割线组件的辅助类"""
|
||
|
|
|
||
|
|
def __init__(
|
||
|
|
self,
|
||
|
|
margin: str = "2em 0",
|
||
|
|
color: str = "#f7889c",
|
||
|
|
style: Literal["solid", "dashed", "dotted"] = "solid",
|
||
|
|
thickness: str = "1px",
|
||
|
|
):
|
||
|
|
data_model = Divider(
|
||
|
|
margin=margin, color=color, style=style, thickness=thickness
|
||
|
|
)
|
||
|
|
super().__init__(data_model, template_name="components/widgets/divider")
|