vue的樣式中使用變數及運用
阿新 • • 發佈:2021-02-04
技術標籤:javaScriptvuejsvue
<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);
}