微信小程序就是 Vue 吗?

微信小程序就是 Vue 吗?

https://www.zhihu.com/question/50952587?sort=created

表面上看差不多啊,是做了一个可能是 vue native 的东西吗?跟 weex 有何异同?
关注者
247
 
被浏览
42474
 

14 个回答

明显不是嘛,数据属性更新是这样的
小程序:
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>

恩,还是有点像。
 
posted @ 2017-12-11 15:05  sky20080101  阅读(214)  评论(0)    收藏  举报