Refs
提供了 wx:ref="xxx"
来更方便获取 WXML 节点信息的对象。在JS里只需要通过this.$refs.xxx 即可获取节点。
示例:
<template>
<view wx:ref="tref">
123
</view>
</template>
<script>
import {createComponent} from '@mpxjs/core'
createComponent({
ready () {
this.$refs.tref.fields({size: true}, function (res) {
console.log(res)
}).exec()
}
})
</script>