是否可以在模板文字中返回一个字符串值,ForEach
以便将其添加到那个地方?因为如果我记录它,它会返回undefined
. 或者这就像我输入的根本不可能?
return `<div>
<form id='changeExchangeForViewing'>
<label for='choiceExchangeForLoading'>Change the exchange</label>
<div class='form-inline'>
<select id='choiceExchangeForLoading' name='choiceExchangeForLoading' class='form-control'>
${Object.keys(obj).forEach(function (key) {
return "<option value='" + key + "'>" + obj[key] + "</option>"
})}
`;