wxml中显示AV对象的pointer属性值问题。
{{item.room.name}}列表中,如果显示元素的pointer属性的对象时,子对象的属性获取不到。
但是在js中可以打印出来。

wxml中显示AV对象的pointer属性值问题。
{{item.room.name}}列表中,如果显示元素的pointer属性的对象时,子对象的属性获取不到。
但是在js中可以打印出来。

代码如下:
wxml:

<block wx:if="{{list}}" wx:for="{{list}}">
    <view class="chat-item flex-wrp " bindtap="showActionSheet" data-index="{{index}}">
      <view class="avatar flex-item">
        <image src="{{item.room.picurl[0]}}"></image>
      </view>
      <view class="chat-content flex-item">
        <view class="chat-source">
          <text class="chatmate">{{item.name}}</text> //这里可以显示
          <text class="chatmate">{{item.room.name}}</text>  //item的pointer属性room的属性不能显示
          <text class="lasttime">{{item.room.creater}}</text>
        </view>
        <text class="chat-txt">{{item.room.desc}}</text>
      </view>
    </view>
  </block>

在js中:可以打印出来:
console.log(scm.room.name);

请问楼主这个问题怎么解决的?

使用最新版的 SDK(v3)即可直接将嵌套的 AV.Object 作为 data 绑定,并在 wxml 中直接通过 {{item.room.name}} 来访问。

多谢多谢!!!