angular - 回答问题时如何使用 [style.border] 更改边框样式?
问题描述
回答问题后,我无法将边框样式从 $vivid-blue 更改为 $medium-gray。这是我的代码:
<section id="question" [style.border]="!answer ? 'unanswered': 'answered'">
在 SCSS 中我有
.unanswered {
border: 2px solid $vivid-blue !important;
}
.answered {
border: 2px solid $medium-gray !important;
}
解决方案
这个:
<section id="question" [ngClass]="!answer ? 'unanswered': 'answered'">
或这个:
<section id="question" [style.border]="!answer ? 'border: 2px solid blue !important': 'border: 2px solid gray !important'">
推荐阅读
- apache-nifi - 在 Nifi 中将计数器实现为流文件属性
- c++ - C++ MS Visual Studio 错误“在函数公共中引用:void __thiscall ...”
- node.js - 安装 Angular CLI 时收到错误警告
- django - DRF:使用 Client() 测试 POST 方法
- azure - 将 ServiceNow 用户迁移到 Azure AAD
- locust - 如何安装 locust swarm 并在 windows 中工作?
- php - 使用 php 发送 fcm 通知和消息
- symfony - 使用 api 平台过滤具有继承的实体
- node.js - 对谷歌数据存储模拟器的查询不断执行
- ios - dyld:库未加载:iOS 应用程序崩溃 Xcode 11.3