微信小程序template模板
2020-04-23 本文已影响0人
海豚先生的博客
// 定义在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'