vue-proportion-directive
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "vue-proportion-directive", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "vue 固定元素比例指令", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
# vue比例指令 | ||
让元素能够按照一定的比例显示 | ||
根据元素宽度,按比例设置元素高度 | ||
# USE | ||
## install | ||
```shell | ||
npm install vue-proportion-directive --save | ||
``` | ||
## code | ||
javascript | ||
```javascript | ||
import proportion from 'vue-proportion-directive'; | ||
Vue.use(proportion); | ||
``` | ||
html | ||
```html | ||
<template> | ||
<!-- 这个元素的高度会是宽度的0.5倍 --> | ||
<div v-proportion="0.5"> | ||
这里是头部 | ||
</div> | ||
</template> | ||
``` |
6074
29