# Sticky ### Install ```js import Vue from 'vue'; import { Sticky } from 'vant'; Vue.use(Sticky); ``` ## Usage ### Basic Usage ```html Basic Usage ``` ### Offset Top ```html Offset Top ``` ### Set Container ```html
Set Container
``` ```js export default { data() { return { container: null, }; }, mounted() { this.container = this.$refs.container; }, }; ``` ## API ### Props | Attribute | Description | Type | Default | | ---------- | ------------------- | ------------------ | ------- | | offset-top | Offset top | _number \| string_ | `0` | | z-index | z-index when sticky | _number \| string_ | `99` | | container | Container DOM | _Element_ | - | ### Events | Event | Description | Arguments | | ------ | --------------------- | ------------------------------ | | scroll | Triggered when scroll | object: { scrollTop, isFixed } |