循环遍历Handlebars.js中的多维数组

use*_*321 33 html javascript handlebars.js

我让服务器传回这个JSON,我不知道如何在Handlebars中循环一个二维数组.

"userSurvey":[[1],[2],[3]]
Run Code Online (Sandbox Code Playgroud)

我知道要使用,{{#each userSurvey}}但那我将如何进行usersurvey对象内部的数组?

Sim*_*ias 67

你必须循环2次:

{{#each userSurvey}}
  {{#each this}}
    {{ this }}
  {{/each}}
{{/each}}
Run Code Online (Sandbox Code Playgroud)