如何在 Angular Material textarea 字段上添加边框?

How do I add a border on a Angular Material textarea field?

我正在使用 Angular 和 Material 设计组件。如何使用 CSS 在文本区域输入字段周围添加边框?

来自 https://material.angular.io/components/input/examples 的示例文本区域:

<form class="example-form">
  <mat-form-field class="example-full-width">
    <textarea matInput placeholder="Leave a comment"></textarea>
  </mat-form-field>
</form>

What the default textarea looks like

如果您将 appearance="outline" 添加到 mat-form-field,它会在您的字段周围添加边框

来源:https://material.angular.io/components/form-field/overview

 <mat-form-field class="example-full-width" appearance="outline">
    <textarea matInput placeholder="Leave a comment"></textarea>
  </mat-form-field>