1 /** 2 * ``即重音符(128键盘左上角ESC下面那个键盘) 3 * 隶属:模板字符串 4 */ 5 6 let unit = ‘4‘; 7 let keywords = ‘uc‘; 8 9 // step1:模板变量 ${variable_name} 10 let url = `Shell${keywords}${unit}`; 11 console.log(url); 12 13 // 旧 14 let urls = ‘Shell‘ + keywords + unit; 15 console.log(urls); 16 17 18 19 // step2: 模板制作(更加智能化) 20 let view = ` 21 <view class="${url}">${unit}</view> 22 <view class="${url}${unit}">${unit}</view> 23 `; 24 console.log(view); 25 26 // 旧 27 let views = "<view class=" + url + unit + ">" + url + "</view>"; 28 console.log(views);
原文地址:https://www.cnblogs.com/cisum/p/9581939.html
时间: 2024-10-18 11:13:14