<el-checkbox-group v-model="param.valueArray" @change="valueArrayChange()" text-color="#FFF" fill="rgba(192, 196, 204, 1)" size="mini">
<el-checkbox-button v-for="item in param.conductStatusList" :label="item.id" :key="item.id" :checked="item.checked">
<!-- <span v-if="item.checked">{{ item.content }}</span> -->
<span v-if="param.valueArray.indexOf(Number(item.id)) === -1" v-bind:style="item.color">{{ item.content }}</span>
<span v-if="param.valueArray.indexOf(Number(item.id)) >=0">{{ item.content }}</span>
</el-checkbox-button>
</el-checkbox-group>
核心代码
<span v-if="param.valueArray.indexOf(Number(item.id)) === -1" v-bind:style="item.color">{{ item.content }}</span>
<span v-if="param.valueArray.indexOf(Number(item.id)) >=0">{{ item.content }}</span>
model值数据有无,来改变页面上,未选中状态的颜色。同理可以举一反三。