离子4:行动表css问题
Ionic4操作表控制器不使用CSS 这是我的ts代码离子4:行动表css问题,css,angular,ionic-framework,ionic4,Css,Angular,Ionic Framework,Ionic4,Ionic4操作表控制器不使用CSS 这是我的ts代码 const actionSheet = await this.actionSheetController.create({ mode: 'md', cssClass: 'match-item-action-sheet red', buttons: [{ ... }] }); 这是我的CSS课程 .match-item-action-sheet{ border-top-left-r
const actionSheet = await this.actionSheetController.create({
mode: 'md',
cssClass: 'match-item-action-sheet red',
buttons: [{ ...
}]
});
这是我的CSS课程
.match-item-action-sheet{
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.red{
color:red;
}
这是现场代码
下面是类匹配项操作表的预期行为
试试上面的代码。使用css类
代替cssClass
请参阅上述问题。在css中使用::ng deep
编辑强>
根据你们附在问题上的图片
将样式设置为.action sheet group.sc ion action sheet md
在css中:
::ng-deep .match-item-action-sheet .action-sheet-group.sc-ion-action-sheet-md{
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
::ng-deep .red .action-sheet-group.sc-ion-action-sheet-md{
color:red!important;
}
在variables.scs中写入以下内容:
.red {
--color: red;
}
以及组件的SCS中的以下内容:
.action-sheet-group {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
操作表按钮的颜色由下面的class.Action Sheet button.sc ion Action Sheet ios
控制,也可以在浏览器检查器中进行验证
如果只需要更改删除部分,请使用此类.action sheet destromical.sc离子操作表ios
添加需要修改的样式,并将其放置在variables.scss中,如下所述
.action-sheet-destructive.sc-ion-action-sheet-ios{
颜色:红色;
}
此外,您还必须进行类似于android中相关类的更改 你能在stackblitz fork中srt你的相关代码并向我们展示链接吗:你检查过你给定的类是否正在添加到html中吗?我已经编辑了我的问题,并在页面底部添加了链接question@SagarKodte不,它没有被添加。命令半径不起作用,尝试使用mode=md以获得更好的视图查看问题中添加的图像,这就是我想要的want@SagarKodte是的,在发布问题之前,我已经根据文档尝试过了,但没有效果
.red {
--color: red;
}
.action-sheet-group {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}