scroll-view做滑动导航,点击初始页面导航始终是第一个,只能点击隐藏后面的导航切换?

小程序 文章 2021-03-12 15:01 51 0 全屏看文

scroll-view做滑动导航,点击初始页面导航始终是第一个,只能点击隐藏后面的导航切换?Scroll-view is used for sliding navigation. Clicking on the initial page navigation is always the first one. You can only click to hide the navigation switch behind?

scroll-view做滑动导航,点击初始页面导航始终是第一个,只能点击隐藏后面的导航切换?

 <scroll-view scroll-x="trueclass="nav"  scroll-with-animation="{{true}}">

            <block wx:for="{{content.article}}wx:for-index="idxwx:for-item="navItemwx:key="idx" >

            <view class="nav-item {{currentTab == idx ?'active':''}}"  data-current="{{idx}}bindtap="switchNav">{{navItem.tag_name}}</view>

            </block>        

    </scroll-view>

点击导航触发switchNav函数,但是点击初始页面的导航栏switchNav始终是第一个,点击隐藏后面的导航switchNav才能获取当前点击的导航

{{ navItem.tag_ Name} < / View > < / block > < / scroll View > click navigation to trigger the switchnav function, but click the navigation bar of the initial page, switchnav is always the first one, and click the hidden navigation switchnav to get the current navigation

回答:

Brother斌🎈:

读了几遍都读不明白想表达什么

弄个包含js的代码片段来看看https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

😮😮:

不太明白

默垂眸:

没懂你在说啥

贴下图

-EOF-