// 定义在common文件中
<template name="userInfo">
<view>{{age}}{{index}}</view>
</template>
// 使用a.wxml
<import src='相对路径' />
<template is='userInfo' data='{{...item}}'>
// a.js
item={index:4,age:18,gender:true}
// wxss中引用样式文件a.wxss
@import '../common/template.wxss'
网友评论