Affix
Basic Usage
Fixes elements relative to the window during native scrolling; can also be configured with scrollbar.
<template>
<b-affix :offset="80">
<b-button type="primary">Fixed at 80px from the top</b-button>
</b-affix>
</template>Fixed Position
Can set a fixed position at a distance from the bottom
<template>
<b-affix :offset="20" position="bottom">
<b-button type="primary">Fixed at 20px from the bottom</b-button>
</b-affix>
</template>Props
| Parameter | Description | Type | Options | Default |
|---|---|---|---|---|
| offset | Trigger offset from window position | Number | — | 0 |
| position | Can be set to offset from top or bottom | String | top、bottom | top |
| z-index | Z-index level | Number | — | 10 |
Events
| Event Name | Description | Return Value |
|---|---|---|
| change | Triggers when fixed state changes | true/false |
| scroll | Scroll response event, returns an object containing scrollTop and fixed | Object |
Slot
| Name | Description |
|---|---|
| default | Warning/alert content |