const dataDemo = require('./dataDemo') /* {{~it.data :item:index}} {{? index % 2 === 1 }} {{?}} {{? index % 2 === 0 }} {{?}} {{~}} */ // 上述模板经过模板引擎编译成版本函数,可通过 olado.github.io/doT/index.html 在线获得 function anonymous(it) { var out = ' '; var arr1 = it.data; if (arr1) { var item, index = -1, l1 = arr1.length - 1; while (index < l1) { item = arr1[index += 1]; out += ' '; if (index % 2 === 1) { out += ' '; } out += ' '; if (index % 2 === 0) { out += ' '; } // // out += ' '+' '+' '; } } out += ' '; return out; } module.exports = anonymous;