小程序树形json如何渲染
发布于 5 年前 作者 yshen 13421 次浏览 来自 问答
<template name="questionAnswer">
    <!-- 追问追答html -->
    <view class="QuestionAnswer">
      <view class="AskQuestion">
        <view class="myleft">
          {{Contents}}
        </view>
        <view class="myright">
          <text class="subtitle" style="margin-left: 5px;text-align:center;line-height:50rpx;">追问</text>
        </view>
      </view>
      <view class="AskAnswer" wx:if="{{children.ID}}">
        <view class="myleft">
          {{children.Contents}}
        </view>
        <view class="myright">
          <text class="subtitle" style="margin-left: 5px;line-height:50rpx;">追答</text>
        </view>
      </view>
      <!-- <template is="questionAnswer" data="{{...children.children}}"></template> 这句代码不起作用-->
    </view>
  </template>
回到顶部