为什么 wxml中调用数组的 .includes 方法返回的不是布尔值,而是undefined?

小程序 文章 2020-08-09 11:41 1330 0 全屏看文

AI助手支持GPT4.0

为什么 wxml中调用数组的 .includes 方法返回的不是布尔值,而是undefined?Why does the .includes method of the array in wxml return not a boolean value, but undefined?

为什么 wxml中调用数组的 .includes 方法返回的不是布尔值,而是undefined?

基础库 2.10.4


wxml 代码:

showSetting 数组:

渲染结果:

Basic library 2.10.4 wxml Code: showsetting array: rendering result:

回答:

Distance:

用wxs处理后返回

LeeJim🌀:

wxml里的模板支持的语法有限,可以参考文档。

https://developers.weixin.qq.com/miniprogram/deveference/wxml/data.html

?:

这个js方法只能在js里写,行间不支持。

-EOF-

AI助手支持GPT4.0