Managed to get it to work. @ZimSystem is correct about this.
.has-danger
exist in Alpha version but it was removed in Bootstrap v4 Beta. You will need to use is-invalid
selector in the input and also include class="invalid-feedback"
for error message.
Here is example:
<div class="form-group has-danger">
<label class="form-control-label">Username</label>
<input type="text" class="form-control is-invalid">
<div class="invalid-feedback">Sorry, that username's taken. Try another?</div>
</div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…