赞
踩
:style="selectStyle(scope.row.pMTaskStatus)"
selectStyle(val) {
switch (val) {
case '0':
return { backgroundColor: '#e6a23c',borderColor: '#e6a23c',borderRadius:'4px'}
case '1':
return { backgroundColor: '#409eff',borderColor: '#409eff',borderRadius:'4px'}
case '2':
return { backgroundColor: '#909399',borderColor: '#909399',borderRadius:'4px'}
default:
return { backgroundColor: '#909399',borderColor: '#909399',borderRadius:'4px'}
}
},
<el-select v-model="scope.row.pMTaskStatus" :style="selectStyle(scope.row.pMTaskStatus)" @change="handleChangeType($event,scope)">
<el-option
v-for="option in options"
:key="option.value"
:label="option.label"
:disabled="scope.row.pMTaskStatus === '2'"
:value="option.value"
>
{{ option.label }}
</el-option>
</el-select>
备注:由于直接设置样式是不能生效的,因为会被input标签遮挡,随意我们还要给input标签设置背景颜色为透明色。background-color: transparent;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。