// 引用css(其他页面的)
/* index.wxss*/
@import "../mover_img/mover_img.wxss";
/* index.wxml*/
<!-- 引入文件一 -->
<import src="moves_lister/moves_lister" /> // moves_lister.wxml 中的template
<import src="mover_img/mover_img"/>
<view class="conter" wx:if="{{islocker}}">
<template is="moves_lister" data ="{{...inTheaters}}"></template>
<template is="moves_lister" data ="{{...comingSoon}}"></template>
<template is="moves_lister" data ="{{...top250}}"></template>
</view>
<view class="detw_imgss" wx:if="{{isdetw}}">
<template is="mover_img" wx:for="{{result.movies}}" wx:key="item" data="{{...item}}"></template>
</view>
</view>
/*moves_lister.wxml */
<template name="moves_lister"> //name是关键
<view class="menu_imgs" data-ID="{{id}}" catchtap="datailsID">
<image src="{{imggeurl}}"></image>
<text>{{title}}</text>
</view>
</template>
<template is="moves_lister" 中的 is值是被引用page页模板的name字段 //name是关键
// 嵌套循环
<view class="todaySession" wx:for="{{DateShow}}" wx:key="item" >
<view class="Sessions" wx:for="{{item}}" wx:for-item="items" wx:key="items">
<view class="Sessionstime1">{{items.name}}</view>
</view>
</view>
<view class="todaySession" wx:for="{{DateShow}}" wx:key="item" wx:if="{{reshow[index]}}">
<view class="Sessions" wx:for="{{DateShow[index]}}" wx:for-item="items" wx:key="items">
<view class="Sessionstime1">{{items.name}}</view>
</view>
</view>
网友评论