vue的滚动scroll事件 实现某元素吸顶或者固定位置显示
转载https://blog.csdn.net/wang1006008051/article/details/78003974
兼容ioshttps://www.cnblogs.com/yunyea/p/7753851.html
<template>
<div>
<div style="height:300px"></div>
<div class="searchBar" id="searchBar">
<ul :class="searchBarFixed == true ? 'isFixed' :''">
<li>区域</li>
<li>价格</li>
<li>房型</li>
<li>更多</li>
</ul>
</div>
<div style="height:1000px"></div>
</div>
</template>
<script>
export default {
data () {
return {
searchBarFixed:false