微信小程序使用js方法处理字符串

 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>
原文地址:https://www.cnblogs.com/saonian/p/9377740.html