update readme

This commit is contained in:
wangwenzhang
2020-04-03 18:30:46 +08:00
parent c5996bfc85
commit cfdeffeb99
4 changed files with 42 additions and 140 deletions

View File

@@ -2,7 +2,7 @@
![npm](https://img.shields.io/npm/v/@hoc-element/affix) ![NPM](https://img.shields.io/npm/l/@hoc-element/affix)
📌 将页面元素固定在可视范围内。
📌 将页面元素固定在可视范围内。
## Environment Support
@@ -22,3 +22,33 @@ import HocElementAffix from '@hoc-element/affix'
Vue.use(HocElementAffix)
```
## Using
可选参数
| 字段 | 说明 | 类型 | 默认值 |
| -------- | -------- | -------- | -------- |
| offsetTop | 距离窗口顶部多少时开始固定 | Number | 0 |
## Demo
```html
<template>
<hoc-el-affix
:offsetTop="10"
>
<div class="demo"></div>
</hoc-el-affix>
</template>
<style lang="scss" scoped>
.demo {
position: absolute;
width: 150px;
height: 300px;
border: 1px solid red;
}
</style>
```