var()函数的使用
注意:var()函数完全不兼容ie
使用方法:
<template>
<div class="editing" :style="styleVar">
</div>
</template>
export default {
props: ["editHeight"],
computed: {
styleVar() {
return {
"--edit-height": this.editHeight + "px",
};
}
}
}
.editing {
width: 100%;
height: var(--edit-height);
}