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('

Sticky 黏性组件

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

Sticky 属性

属性说明类型可选值默认值
offset距离顶部或者底部的距离number-0
zIndex设置元素的堆叠顺序number-999
className设置指定的classstring/number--
position定位方式,默认为(top),表示距离顶部位置,可以设置为top或者bottomstringtop/bottomtop
',7);p.render=function(s,n,p,o,c,l){return t(),a("div",null,[e])};export default p;export{n as __pageData};