sunday123

通常在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的运算结果 -->

 

分类:

技术点:

相关文章:

  • 2021-11-28
  • 2021-05-13
  • 2021-11-17
  • 2021-05-23
  • 2021-08-21
  • 2022-01-08
  • 2021-08-21
  • 2021-08-18
猜你喜欢
  • 2021-10-31
  • 2021-11-17
  • 2021-10-04
  • 2022-01-01
  • 2021-11-15
相关资源
相似解决方案