标签:程序 模板 -- 一个 html func utils ber module
通常在utils中创建一个.wxs后缀的文件(例如:fn.wxs)
function addition(a,b){
return Number(a)+Number(b);
}
module.exports = {
addition:addition,
}
需要逻辑运算的wxml页面
<wxs src="../../utils/fn.wxs" module="tool" />
<view class="nowpage">{{tool.addition(page.index,1)}}</view><!-- 得到page.index+1的运算结果 -->
标签:程序 模板 -- 一个 html func utils ber module
原文地址:https://www.cnblogs.com/sunday123/p/13152157.html