ES6模板字符串中使用循环并取值

let tempul=`<ul>
						${this.mapInfoshowList.map(item=>{
							let tempid = `${item.id}`
							return `<li><i class="el-icon-star-on"></i>&nbsp;${item.name}:&nbsp;${ele[item.id]}</li>`
						}).join('')}
						</ul>`
					var content1 = `<div class="mymapinfo">
										${tempul}
										<p><i class="el-icon-location"></i>&nbsp;位置:&nbsp;`+ele.weizhi+`</p>
										<div style="border-top:1px dashed #919191;padding-top:8px;color:rgb(64, 158, 255);font-size:12px;width:98%">
											<span onclick='guijihuifang()'>轨迹回放</span>&nbsp;&nbsp;
											<span >车辆追踪</span>&nbsp;&nbsp;
											<span >实时视频</span>&nbsp;&nbsp;
											<span >历史视频</span>&nbsp;&nbsp;
											<span onclick='cymingling()'>常用命令</span>&nbsp;&nbsp;
											<span >查看街景</span>&nbsp;&nbsp;
										</div>
									</div>`

上一篇:jQuery操作控件


下一篇:HDU 1061 Rightmost Digit题解