收藏
回答

模板data="" 为什么不能传对象的某个属性-该属性值为一个Number类型


```html

<view class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active"

wx:for="{{panelList}}" wx:for-index="idx" wx:key="idx">

<view class="weui-media-box__hd weui-media-box__hd_in-appmsg">

<image class="weui-media-box__thumb" src="{{item.imgUrl}}" />

view>

<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">

<view class="weui-media-box__title">

<view class="title-txt">{{item.name}}view>

<view class="status online" wx:if="{{item.state.length > 0}}">{{item.state}}view>

{{item.star}}

<template is="star" data="{{item.star}}">template>

view>

<view class="weui-media-box__desc">{{item.info}}view>

view>

view>

```



为什么不能这样传递呢?

最后一次编辑于  2017-09-29
回答关注问题邀请回答
收藏

1 个回答

  • liahong
    liahong
    2018-10-31

    不应该这样传值,正确的传值方法是:data = 'star:item.star'

    2018-10-31
    有用
    回复
登录 后发表内容