Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of wxs files in WeChat Mini Programs?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about what wxs files in Weixin Mini Programs are used for. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

preface

wxs files are logical files in Mini programs that are used in conjunction with wxml.

Unlike js, wxs can be applied directly to the view layer without the need for setData data interaction between the view layer and the logical layer;

Because of this feature, wxs is well suited for optimizing frequent interactions with Mini programs;

apply filters

Wxs runs much faster than JS in IOS, and the two perform equally well in Android.

Using wxs as a filter can also improve performance somewhat; let's look at a filter to understand its syntax.

wxs file:

var toDecimal2 = function (x) { var f = parseFloat(x); if (isNaN(f)) { return '0.00' } var f = Math.round(x * 100) / 100; var s = f.toString(); var rs = s.indexOf('. '); if (rs < 0) { rs = s.length; s += '. '; } while (s.length

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report