/* index.json */{ "usingComponents": { "child": "../../components/Child/Child" }}/* index.js */Page({ data : { a : [1], b : [2] }})/* index.wxml */<view> <child tags="{{a}}"></child> <child tags="{{b}}"></child> <child tags="{{a.concat(b)}}"></child></view>//----------------------------------/* Child.json */{ "component": true}/* Child.js */Component({ properties: { tags : { type : Array, } }, ready(){ console.log(this.data.tags); },})
/* console results*/// [1]// [2]// [] |
最后的console输出的是空数组

你好,{{ }} 中不支持绝大多数的 JS 内置对象方法,仅支持简单运算符。