1 <wxs module="m1"> 2 var getinfo = function(message,info) { 3 message_arr=message.split("|"); 4 return message_arr[info] 5 } 6 module.exports = { 7 getinfo: getinfo, 8 }; 9 10 </wxs> 11 12 13 <view> {{m1.getinfo("1|2",1)}} </view> 14 <view> {{m1.getinfo("1|2",0)}} </view>