当前位置:网站首页>In wechat applet, the externally introduced JS is used in xwml for judgment and calculation
In wechat applet, the externally introduced JS is used in xwml for judgment and calculation
2022-07-02 03:28:00 【Today is Saturday】
Use scene
- The same page shows two arrays , stay js It is troublesome to calculate the array length in
- Can be found in wxml Operation in
stay wxml Use in ( Put it in wxml Introduce in the file )

<view class="item-info">
<view class="item-title"> Reviewed by the owner </view>
<wxs src="../../utils/calculate.wxs" module="tools" />
<view class="wait" wx:if="{
{tools.calculate(new_list,new_list_gs)>0}}"> To audit : {
{
tools.calculate(new_list,new_list_gs)}}</view>
</view>
establish The suffix is wxs The file of
function calculate(str1, str2) {
if (str1) {
return str1.length + str2.length
} else {
return '0'
}
}
module.exports = {
calculate: calculate
}
边栏推荐
- 《MATLAB 神经网络43个案例分析》:第42章 并行运算与神经网络——基于CPU/GPU的并行神经网络运算
- Kotlin基础学习 14
- [JS reverse series] analysis of a customs publicity platform
- Apple added the first iPad with lightning interface to the list of retro products
- PY3, PIP appears when installing the library, warning: ignoring invalid distribution -ip
- Unity脚本的基础语法(6)-特定文件夹
- Common means of modeling: aggregation
- Yan Rong looks at how to formulate a multi cloud strategy in the era of hybrid cloud
- Kotlin basic learning 15
- FFMpeg AVFrame 的概念.
猜你喜欢

Verilog timing control

halcon图像矫正

Generate random numbers that obey normal distribution

Detailed explanation of ThreadLocal

JS <2>

Docker installs canal and MySQL for simple testing and implementation of redis and MySQL cache consistency

Verilog avoid latch

焱融看 | 混合云时代下,如何制定多云策略

【DesignMode】原型模式(prototype pattern)
![[JS reverse series] analysis of a customs publicity platform](/img/15/fdff7047e789d4e7c3c273a2f714f3.jpg)
[JS reverse series] analysis of a customs publicity platform
随机推荐
初出茅庐市值1亿美金的监控产品Sentry体验与架构
Global and Chinese market of handheld ultrasonic scanners 2022-2028: Research Report on technology, participants, trends, market size and share
32, 64, 128 bit system
venn圖取交集
GSE104154_scRNA-seq_fibrotic MC_bleomycin/normalized AM3
/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW/GSM5598265_matrix_inflection_demult
Verilog parallel block implementation
In depth analysis of C language - variable error prone knowledge points # dry goods inventory #
Intersection vengraph
One of the future trends of SAP ui5: embrace typescript
Unity脚本的基础语法(7)-成员变量和实例化
Review materials of project management PMP high frequency examination sites (8-1)
venn图取交集
Retrofit's callback hell is really vulnerable in kotlin synergy mode
数据库文件逻辑结构形式指的是什么
Verilog avoid latch
Mathematical calculation in real mode addressing
Load different fonts in QML
aaaaaaaaaaaaa
Halcon image rectification