WeChat拆分模块
1、创建模块
用name
<template name="swiper">
<swiper class="swiper" loop="true" autoplay="true" interval="2000" indicator-dots="true" circular="true" duration="1000" skip-hidden-item-layout="true" indicator-active-color="#fff">
<swiper-item wx:for="{{ banner }}" wx:key="{{index}}">
<image src="{{item.picUrl}}"></image>
</swiper-item>
</swiper>
</template>
2、导入
用is
<!-- 搜索框下纵向滚动公告 -->
<import src="modular/swiper/swiperDown.wxml" />
<template is="swiperDown" data="{{data:msgList}}"></template>
<!-- 轮播图 -->
<import src="modular/swiper/swiper.wxml" />
<template is="swiper" data="{{banner:swiper}}"></template>