for循环动态改变样式状态
vue部分
//- 安全风险/质量标准内容页面 .risk_quality_details template(v-if="detailObj.option === 'textTab'") .work_list_details2(v-for="item in risk_quailty_content") .risk_tag.risk_detail {{item.label}} .risk_detail-img .risk_detail(:style="riskStyle(item.prop)") {{item.value}}
js部分
riskStyle (item) { let riskHeight if (item === 'securityMeasure') { riskHeight = 'calc(100% - 100px)' } else if (item === 'qualityStandard') { riskHeight = 'calc(100% - 45px)' } else { riskHeight = '' } return { height: riskHeight, overflowY: 'auto' } },
参考: https://blog.csdn.net/u011584949/article/details/83821278