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.
1. Select a line of code in the file
2. Then use //in front of the code for comments.
3. In addition, we can also in the head and tail part of the code do not add / and / , is also a comment!
4. Turn on the simulator.
5. Below we find that the content is blank because our code is commented out and it doesn't work