nurupo
V2EX  ›  微信

小程序数据绑定问题,麻烦各位提供一下思路

  •  
  •   nurupo · Oct 27, 2021 · 1634 views
    This topic created in 1684 days ago, the information mentioned may be changed or developed.

    如图所示,我需要把离开时间显示在对话框上

    <view class="direction-row" wx:for="{{dataList}}" wx:key="index">
        <view class="title">预定离开时间:</view>
        <view>{{item.leaveTime}}</view>
    </view>
    

    遍历 dataList 会显示两条数据。我只想显示当前点击的一条数据,请问怎么获取当前的 index ,或者有什么其他的写法?

    nurupo
        1
    nurupo  
    OP
       Oct 27, 2021
    自己解决了,用点击事件获取的 index 去取数据
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5280 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 09:22 · PVG 17:22 · LAX 02:22 · JFK 05:22
    ♥ Do have faith in what you're doing.