diff --git a/src/sticky/README.md b/src/sticky/README.md index ecf138340..b96ba64ff 100644 --- a/src/sticky/README.md +++ b/src/sticky/README.md @@ -38,6 +38,14 @@ app.use(Sticky); ``` +### Offset Bottom + +```html + + Offset Bottom + +``` + ```js export default { setup() { @@ -54,6 +62,8 @@ export default { | Attribute | Description | Type | Default | | --- | --- | --- | --- | | offset-top | Offset top, supports `px` `vw` `vh` `rem` unit, default `px` | _number \| string_ | `0` | +| offset-bottom | Offset bottom, supports `px` `vw` `vh` `rem` unit, default `px` | _number \| string_ | `0` | +| position | Offset position, supports `top` `bottom` | _string_ | `top` | | z-index | z-index when sticky | _number \| string_ | `99` | | container | Container DOM | _Element_ | - | diff --git a/src/sticky/README.zh-CN.md b/src/sticky/README.zh-CN.md index 031bb30bc..a80e8f018 100644 --- a/src/sticky/README.zh-CN.md +++ b/src/sticky/README.zh-CN.md @@ -48,6 +48,16 @@ app.use(Sticky); ``` +### 吸底距离 + +通过 `offset-bottom` 属性可以设置组件在吸底时与底部的距离。通过 `position` 属性控制吸附位置,默认值为 `top`。 + +```html + + 吸底距离 + +``` + ```js export default { setup() { @@ -64,6 +74,8 @@ export default { | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | offset-top | 吸顶时与顶部的距离,支持 `px` `vw` `vh` `rem` 单位,默认 `px` | _number \| string_ | `0` | +| offset-bottom | 吸底时与底部的距离,支持 `px` `vw` `vh` `rem` 单位,默认 `px` | _number \| string_ | `0` | +| position | 吸附位置,支持 `top` `bottom` | _string_ | `top` | | z-index | 吸顶时的 z-index | _number \| string_ | `99` | | container | 容器对应的 HTML 节点 | _Element_ | - | diff --git a/src/sticky/demo/index.vue b/src/sticky/demo/index.vue index 9f0ad7f78..4ca62a1a8 100644 --- a/src/sticky/demo/index.vue +++ b/src/sticky/demo/index.vue @@ -24,6 +24,15 @@ + + +
+ + + {{ t('offsetBottom') }} + + +