Attribute matListItemTitle is not allowed here

问题描述 投票:0回答:1

尝试在 Angular 应用程序中实现来自 Angular Material 的列表。 WebStorm 出现上面标题中写的消息。

我发现问题here但在这种情况下我不能调用

matListItemTitle
作为动态参数(如该帖子末尾所述)。

<h3>Two line lists</h3>
<mat-list>
  <mat-list-item>
    <span matListItemTitle>Title</span>
    <span matListItemLine>Second line</span>
  </mat-list-item>
  <mat-list-item>
    <span matListItemTitle>Title</span>
    <span>Second line</span>
  </mat-list-item>
  <mat-list-item>
    <span matListItemTitle>Title</span>
    Second line
  </mat-list-item>
</mat-list>
angular angular-material webstorm
1个回答
0
投票

我最近遇到了同样的问题。就我而言,我使用的是旧版本的angular (14.2.7)。根据角度组件文档,

matListItemTitle
matListItemLine
属性在 angular 15

中引入

注意事项: 使用 Jetbrains Rider 2022.3.2

© www.soinside.com 2019 - 2024. All rights reserved.