微信小程序实现调用后端接口后,拿到我们想要的数据后,如何显示在picker组件(select下拉列表)中的问题
以我的项目中实现效果为例
.wxml文件
<view class="row">
<view class="name">厂商PM:</view>
<view class="text" data-index="{
{index}}" bindtap="pmSelectPage"
style="color: blue;text-decoration:underline dashed;" wx:if="{
{item.factoryPmName!=null}}"
data-id="{
{item.id}}">
{
{item.factoryPmName}}</view>
<view class="text" data-index="{
{index}}" bindtap="pmSelectPage" style="color: blue"
wx:if="{
{item.factoryPmName==null}}" data-id="{
{item.id}}">---
</view>
</view>
<view class="pm-mask" wx:if="{
{showModal}}"></view>
<view class="pm-dialog" wx:if="{
{selectPmFlag}}">
<view class="pm-header pm-top">添加厂商Pm</view>
<form bindsubmit="formFmSubmitUpdate">
<view class="pm-content">
<!--添加厂商Pm -->
<view class="row">