热门
最新
红包
立Flag
投票
同城
我的
发布
白日梦想猿
3 年前
truemax_lll
写完代码再出去遛遛狗,生活可以很充实,也可以很简单
我的假期日常
下一条:
小程序P51 13.wxs的基本用法1、定义内嵌的wxs脚本<!--pages/massage/massage.wxml--><view>{{m1.toUpper(username)}}</view><wxs module="m1"> module.exports.toUpper = function(str){ return str.toUpperCase() }</wxs>// pages/massage/massage.jsdata: { count:0, username:'zhangshan', country:'CHAN' },2、定义外联的wxs脚本//在utils文件下创建tools.wxs文件function toLower(str){ return str.toLowerCase()}module.exports = { toLower:toLower}3、使用外联wxs脚本<!--pages/massage/massage.wxml--><view>{{m2.toLower(country)}}</view><wxs src="../../utils/tools.wxs" module="m2"></wxs>
立即登录