根据元素宽度,按比例设置元素高度
npm install vue-proportion-directive --save
javascript
import proportion from 'vue-proportion-directive';
Vue.use(proportion);
html
<template>
<!-- 这个元素的高度会是宽度的0.5倍 -->
<div v-proportion="0.5">
这里是头部
</div>
</template>