微信小程序wxs封装和使用 老陌笔记 2021-07-22 425 阅读1分钟 <view>{{m2.stime(item)}}</view>//调用方法使用 <wxs module="m2"> var substrs = { stime: function (str) { return str.substring(0,10) console.log(str.length-4) } } module.exports = { stime: substrs.stime//暴露接口调用 } </wxs>