例子:<view id="{{aData.subtableText('a[b]')}}"></view>
<wxs module="aData">
module.exports = {
subtableText: function (text) {
var value = text
if (value.indexOf('[') != -1) {
var reg = getRegExp('[', 'g')
value = value.replace(reg, '');
}
return value
},
}
</wxs>
var reg = getRegExp('\[', 'g')
转义一下