IOS浏览器会把百分号识别成px,所以我们可以根据屏幕宽度将百分比转换成px
getColumnWidth(data) {
const screenWidth = window.innerWidth;
const desiredPercentage = data;
const widthInPixels = (screenWidth * desiredPercentage) / 100;
return widthInPixels + 'px';
},
<el-table-column
type="selection"
:style="{ 'width': getColumnWidth(3) }"
:width="getColumnWidth(3)"
:selectable="checkSelectable"
v-if="hasAuth"
>
el-table-column>