Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program comments


May 18, 2021 WeChat Mini Program Development Document



WXS has three main ways to comment.

Example code:

<!-- wxml -->
<wxs module="sample">
// 方法一:单行注释
/*
方法二:多行注释
*/
/*
方法三:结尾注释。即从 /* 开始往后的所有 WXS 代码均被注释
var a = 1;
var b = 2;
var c = "fake";
</wxs>

In the above example, all WXS code is commented out.

The only difference between method three and method two is that there is no end character.


Example:

1. Select a line of code in the file

WeChat small program comments

2. Then use //in front of the code for comments.

WeChat small program comments

3. In addition, we can also in the head and tail part of the code do not add / and / , is also a comment! WeChat small program comments

4. Turn on the simulator.

WeChat small program comments

5. Below we find that the content is blank because our code is commented out and it doesn't work

WeChat small program comments