当前位置:网站首页>[uni app] the use of scroll into view in uni app
[uni app] the use of scroll into view in uni app
2022-07-28 05:50:00 【Tree_ wws】
uni-app in scroll-into-view Use
List of articles
uni-app in scroll-into-view Use
You need to pay attention to :
Need to give sroll-view Set the width or height of the component ( According to the horizontal and vertical conditions )
white-space:nowrap This line of code enables the component to slide ( I stepped on the pit when I wrote it before )
Use scroll-into-view, You need to turn on the animation effect , And the value of dynamic binding must be a string
And the sub component is bound with a id Value for positioning

<template>
<view class="scroll-wrapper">
<scroll-view
scroll-x="true"
class="scroll"
enable-flex='true'
scroll-with-animation
:scroll-into-view="'tab'+ tabId">
<view :id="'tab'+index" :class="active == index ? 'active' :''"
v-for="(item,index) in navList"
:key="index"
@click="selectActive(index)">{
{
item}}</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
active:0,
tabId:0
}
},
methods:{
selectActive(index){
this.active = index
this.tabId = index
}
}
}
</script>
summary
That's what we're going to talk about today , I hope that's helpful !!!
边栏推荐
猜你喜欢

A file upload tool website written by individuals

ArcGIS Engine Development Resources

Cad-gis data conversion

DOM模型的相关概念和操作

Online word cloud generation (taking WordArt as an example)

ArcGIS地图制作的注记、格网添加

Making E-R diagram based on XMIND

cmd和npm基础命令

环形链表问题

Competition arrangement in GIS field (incomplete statistics)
随机推荐
结果填空 煤球数目
C语言通讯录系统
DOM模型的相关概念和操作
简单几步实现小程序分享朋友圈
Review of metallurgical physical chemistry -- cathodic polarization, overpotential, anode and anode process in metal electrodeposition
结果填空 国庆有几天是星期日(纯Excel解决)
树莓派串口配置
null和undefined的区别
Sankey diagram drawing based on highcharts platform
Zotero——一款文献管理工具
Simpledateformat thread unsafe and datetimeformatter thread safe
pytorch安装----CPU版的
Example of MySQL processing legacy data
书籍-社会性动物
Microsoft Edge浏览器插件(2)
树莓派蓝牙调试过程
DOM——页面的渲染、style属性操作、预加载与懒加载、防抖与节流
对极大似然估计、梯度下降、线性回归、逻辑回归的理解
浅谈一段奇妙旅程
正则表达式