WeChat small program indexof replacement method (recommended)

Method: wxs defined by indexOf method, using reference

chestnuts page:

wxs: named str.wxs, deriving defineIndexOf method defined named indexOf

  function defineIndexOf (str, val) {return str.indexOf (val);} module.exports = {indexOf: defineIndexOf}  

wxml:

reference str.wxs, and to name the module toolStr, in the following loop method to use indexOf inside toolStr derived

    {{item.name}}   

ps: the following look small micro-channel does not support the alternative indexof the method

using lastIndexOf but this order is opposite to and indexof

summed

the above is a small series to introduce alternative method indexOf of micro-channel applet, we want to help, if you have any questions please give me a message, Xiao Bian will promptly reply to everyone. Thank you very much for your support of Tumi Cloud Website!
If you think this article helps you, welcome to reprint, please indicate the source, thank you!

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment