Return 带中断的变量
Return Variable with break
我创建了一个返回变量的代码。目前,该变量在一行中返回值 value1、value2 等值。但我需要休息一下
值 1
值2
...
这是我的代码
while (test[i]) {
var total = 0;
var spielerName = '';
Spieltag.find({SpielerID: test[i]}).map(function(doc) {
total += doc.Note;
});
Playerslist.find({SpielerID: test[i]}).map(function(doc) {
spielerName += doc.Name;
});
spielerPkt += spielerName + ": " + total + ", ";
i++;
}
return spielerPkt;
在 html 中,使用 {{TemplateFunction}} 很简单
我可以在 html 中进行调整以满足我的需求,还是必须更改我的 while 循环?
您可以通过向字符串添加 \n
来插入换行符。
我创建了一个返回变量的代码。目前,该变量在一行中返回值 value1、value2 等值。但我需要休息一下 值 1 值2 ...
这是我的代码
while (test[i]) {
var total = 0;
var spielerName = '';
Spieltag.find({SpielerID: test[i]}).map(function(doc) {
total += doc.Note;
});
Playerslist.find({SpielerID: test[i]}).map(function(doc) {
spielerName += doc.Name;
});
spielerPkt += spielerName + ": " + total + ", ";
i++;
}
return spielerPkt;
在 html 中,使用 {{TemplateFunction}} 很简单 我可以在 html 中进行调整以满足我的需求,还是必须更改我的 while 循环?
您可以通过向字符串添加 \n
来插入换行符。