WeChat applet uses function wxs in wxml

Through research, we found that js functions cannot be called in wxml, and format(item.time) and other similar writing methods cannot be used.

The following shows how to use the function wxs in wxml to implement inline writing 

Example: The time is displayed as 00:00

In our data the time is in milliseconds and we need to display it as 0:00 in real time

We write in wxml

 xs is a custom name for the module. We can choose getTime as the function name. We can also choose it according to the function.

Calling method:

We can see the display on the page

Guess you like

Origin blog.csdn.net/weixin_44383533/article/details/130743916