微信小程序与Vue js数据渲染对比

//小程序

Page({
  data: {
    items: []
  },
  onLoad: function(options) {
    this.setData({
      items: [1,2,3]    
    })
  }
})
//Vue

new Vue({
  data: {
    items: []
  },
  mounted () {
    this.items = [1, 2, 3]
  }
})

  

<!--小程序-->

<text wx:for="{{items}}">{{item}}</text>
<!--Vue-->

<text v-for="item in items">{{item}}</text>

  

原文地址:https://www.cnblogs.com/fan-bk/p/8046222.html