简体   繁体   English

定制 header 中 angular 材料手风琴

[英]Custom header in angular material accordion

How can I customize <mat-panel-title> to support a subtitle under a header?如何自定义<mat-panel-title>以支持 header 下的字幕? I try to add some HTML tags but not work.我尝试添加一些 HTML 标签但不起作用。 For now i have this:现在我有这个:

在此处输入图像描述

my stackblitz我的堆栈闪电战

You can use a flex-box display:您可以使用弹性盒显示:

<mat-panel-title style="display: flex; flex-direction: column">
  <span>HEADER</span>
  <span>subtitle</span>
</mat-panel-title>

But do it using a css class selector.但是使用 css class 选择器来实现。

In css file:在 css 文件中:

.column-layout {
  display: flex; 
  flex-direction: column;
}

In your template:在您的模板中:

<mat-panel-title class="column-layout">
  <span>HEADER</span>
  <span>subtitle</span>
</mat-panel-title>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM