浏览代码

Use template string for template in examples/index.html

Marco Fugaro 4 年之前
父节点
当前提交
ebaa5e16f9
共有 1 个文件被更改,包括 10 次插入10 次删除
  1. 10 10
      examples/index.html

+ 10 - 10
examples/index.html

@@ -188,16 +188,16 @@
 
 		function createLink( file ) {
 
-			const template = [
-				'<div class="card">',
-				'	<a href="' + file + '.html" target="viewer">',
-				'		<div class="cover">',
-				'			<img src="screenshots/' + file + '.jpg" loading="lazy" width="400" />',
-				'		</div>',
-				'		<div class="title">' + getName( file ) + '</div>',
-				'	</a>',
-				'</div>'
-			].join( "\n" );
+			const template = `
+				<div class="card">
+					<a href="${file}.html" target="viewer">
+						<div class="cover">
+							<img src="screenshots/${ file }.jpg" loading="lazy" width="400" />
+						</div>
+						<div class="title">${getName( file )}</div>
+					</a>
+				</div>
+			`;
 
 			const link = createElementFromHTML( template );