mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-05-11 21:38:53 +08:00
28 lines
583 B
Markdown
28 lines
583 B
Markdown
```html
|
|
<template>
|
|
<Affix :offset-top="40" :target = "getTarget">
|
|
<span class="demo-class">距离滚动元素.right-panel顶部200px</span>
|
|
</Affix>
|
|
</template>
|
|
<script>
|
|
export default {
|
|
methods: {
|
|
getTarget () {
|
|
return document.getElementsByClassName('right-panel')[0]
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style>
|
|
.demo-class{
|
|
height: 30px;
|
|
padding:0px 10px;
|
|
text-align:center;
|
|
line-height: 30px;
|
|
background: #3399ff;
|
|
color: #fff;
|
|
display: inline-block;
|
|
}
|
|
</style>
|
|
```
|