修改 el-input 样式,当值小于0时,边框红色,提示错误
<el-input v-model='value' :class='isError(value)' />
method: {
isError(val) {
return val < 0 ? 'error-input' : ''
}
}
.error-input /deep/ input {
border-color: #ff0000 !important;
}
修改 el-input 样式,当值小于0时,边框红色,提示错误
<el-input v-model='value' :class='isError(value)' />
method: {
isError(val) {
return val < 0 ? 'error-input' : ''
}
}
.error-input /deep/ input {
border-color: #ff0000 !important;
}