import{o as t,c as a,a as s}from"./app.c38d1953.js";const n='{"title":"Sticky 黏性组件","description":"","frontmatter":{},"headers":[{"level":2,"title":"用法","slug":"用法"},{"level":2,"title":"Sticky 属性","slug":"sticky-属性"}],"relativePath":"components/sticky.md","lastUpdated":1721206001124}',p={},e=s('
1.2.4
新增
Sticky 组件位于 src/components/Sticky 内
<script setup lang="ts">\nimport { Sticky } from '@/components/Sticky'\n</script>\n\n<template>\n <Sticky :offset="90">\n <div style="padding: 10px; background-color: lightblue"> Sticky 距离顶部90px </div>\n </Sticky>\n</template>\n\n
属性 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
offset | 距离顶部或者底部的距离 | number | - | 0 |
zIndex | 设置元素的堆叠顺序 | number | - | 999 |
className | 设置指定的class | string /number | - | - |
position | 定位方式,默认为(top),表示距离顶部位置,可以设置为top或者bottom | string | top/bottom | top |