微信小程序实现computed
原理
小程序的计算属性和Vue.js的不太一样——小程序在.wxml(不是.js)文件中定义(其实是借用wxs标签实现的) 例如:
1 | <view class="container"> |
Tips
在wxs文件中是不能使用this.data去获取到数据的,需要在调用方法时手动传入数据信息,往函数里传入data中的字段,以及在wxs中,很多es6的写法是不支持的!!!!!
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment


