【发布时间】:2022-11-24 21:44:28
【问题描述】:
我想创建一个部分组件,它采用在开始和结束标记之间指定的 html 并添加一个标题。我想要这样做的主要原因是确保标题和内容的边距在整个网站上保持一致。我试图找到如何做到这一点,但我真的不知道如何提出问题以获得我需要的答案。 这是我正在寻找的组件 html 用法和结果的示例
用法:
<custom-component [headerText]='example text'>
<button>example content</button>
</custom-component>
结果:
<custom-component
<div>
<h1>example text</h1>
<button>example content</button>
</div>
</custom-component>
【问题讨论】:
标签: angular