【微信小程序】框架wxml(四)wxml模板

1.首先在wxml中定义template的样式

2.在js中写入几组数据

// pages/wxml2/wxml2.js
Page({
  data: {
    item1: {
      index: 0,
      msg: 'this is the first template',
      time: '2016-09-15'
    },item2: {
      index: 1,
      msg: 'this is the second template',
      time: '2016-09-30'
    }, item3: {
      index: 2,
      msg: 'this is the third template',
      time: '2016-10-09'
    }
  }
})
3.在wxml中使用template模板