在样式表中添加以下代码:
.mat-option {
z-index: $mat-layer-base; // Change this to a high enough value to ensure that the options appear above other components.
}
在上述代码中,“$mat-layer-base”是一个变量,表示基础层的高度值。可以用像“100”这样的常量值替换它,或者添加以下代码来定义它:
$mat-layer-base: 100;
这个变量的值越高,Mat-options组件就会在其他组件上显示得越靠前。