uni-app之app平台:由于v-for中的token和index在【v-bind对象动态绑定的时候】访问不到,所以下面这段代码运行会报错
uni-app之H5平台:H5对v-fortoken和index子组件深度访问支持良好
uni-app框架之V-for语句的作用域总结:app深度有限制,而H5没问题!
<template>
<view class="wallet-assets">
<view class="wallet-title">我的资产</view>
<!-- 上下滑动 -->
<scroll-view class="own-scroll-Y" scroll-y :style="{height:scrollHeight + 'px'}">
<view class="own-scroll-view_Y">
<!--uni-app框架,v-for的作用域对app平台深度有限制,H5深度访问正常-->
<block v-for="(token,index) in tokens" :key="index">
<view class="token">
<!-- uni-app之app平台:由于v-for中的token和index在【v-bind对象动态绑定的时候】访问不到,所以下面这段代码运行会报错 -->
<!-- uni-app之H5平台:H5对v-fortoken和index子组件深度访问支持良好-->
<own-icon-left-right-text-second
:boxStyle="{boxWidth:'80px'}"
:iconStyle="{
type:token.iconClassType,
color:token.iconColor
}"
:textStyle="{
rightText:token.type,
fontSize:'18px'
}" />
</view>
</block>
</view>
</scroll-view>
</view>
</template>