我有以下代码
<mat-tab-group>
<div *ngFor="let question of subcategory.questions">
<mat-tab label={{question.question_id}} class="question-tab">{{question.question}}</mat-tab>
</div>
</mat-tab-group>
Run Code Online (Sandbox Code Playgroud)
显示如下:

但是我想减少标签宽度,如下所示:

问题是,当我在运行时更改css时,它调整得很好,但是当我把css放到:
.mat-tab {
min-width: 50px !important;
}
.mat-tab-label[_ngcontent-c9]{
min-width: 50px !important;
}
Run Code Online (Sandbox Code Playgroud)
它不起作用.知道如何处理这个问题吗?
我尝试使用openlayers 4.6和Angular 5加载WMS图像层,代码是:
const syr_layer = new ol_layer_Image({
source: new ol_source_ImageWMS({
url: 'serverurl', crossOrigin: 'anonymous', serverType: 'geoserver',
params: { 'LAYERS': 'tst:syr'},
projection: 'EPSG:4326'
});
});
Run Code Online (Sandbox Code Playgroud)
但它会抛出一个错误:
GET (myserverurl) 401(在 SecurityContext 中未找到身份验证对象)
如何使用 openlayers 发送的 GET 请求发送身份验证标头?