关键词:微信小程序、下拉选项、下拉数据从后端查询
wxml
<view class='top-selected' bindtap='hindMsg' style="display: flex;" > <button class="title p20" style="width: 70%;" >{{msg}}</button> <button type="primary" style="width: 30%;">新建</button> </view>
<!-- 下拉需要显示的列表 --> <view class="select_box" wx:if="{{select}}" > <view wx:for="{{mycaselist}}" wx:key="pk"> <button class="select_one" style="width: 100%;" bindtap="selectMsg" data-name="{{item.fields.name}}">{{item.fields.name}}</button> </view> </view>
js
data: { select:false, msg:'--请选择--', }, hindMsg() { this.setData({ select: !this.data.select }) }, /** * 已选下拉框 */ selectMsg(e) { var name = e.currentTarget.dataset.name this.setData({ msg: name, select: false }); },
标签:false,name,微信,列表,下拉后,msg,查询,select From: https://www.cnblogs.com/songwmeta/p/17924983.html