博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
js 字符串拼接 html 累加 html 叠加
阅读量:6881 次
发布时间:2019-06-27

本文共 1521 字,大约阅读时间需要 5 分钟。

正常来说已经使用es6 的 模板了如``

//页面层            layer.open({                    type: 1,                    content:`
  • 穿衣 [${this.life.chuanyi[0]}]:

    ${this.life.chuanyi[1]}

  • 感冒 [${this.life.ganmao[0]}]:

    ${this.life.ganmao[1]}

  • 运动 [${this.life.yundong[0]}]:

    ${this.life.yundong[1]}

  • 空调 [${this.life.kongtiao[0]}]:

    ${this.life.kongtiao[1]}

  • 紫外线 [${this.life.ziwaixian[0]}]:

    ${this.life.ziwaixian[1]}

`});

 

但极少情况下还是使用原始的拼接,以下这种方法会比较舒服

var panelBuffer = '
\
\
\
\
\
\
\
\
'; var pickerBuffer = '
\
\
\
    \
\
\
\
';

 

转载于:https://www.cnblogs.com/CyLee/p/5992673.html

你可能感兴趣的文章
vmware格式转换
查看>>
beego mysql in查询
查看>>
git 回退版本
查看>>
go mod 在使用私有gitlab时“go-get=1”错误解决
查看>>
Tableau Server 9.1.2 配置集群手册
查看>>
java逻辑运算符
查看>>
org.bson.codecs.configuration.CodecConfigurationException
查看>>
jsoup抓取网页+详细讲解
查看>>
Python实现修改Windows CMD命令行输出颜色(完全解析)
查看>>
HQL语句讲解
查看>>
服务器安全狗linux版 V2.4 发布 增加网页木马扫描
查看>>
安全狗服云web端V3.4(企业服务)版上线
查看>>
在Android Library的Module中按渠道依赖
查看>>
对javascript匿名函数的理解(透彻版)
查看>>
使用virtualbox安装centos6的内置无线网卡桥接设置
查看>>
java调用http接口(HttpURLConnection的使用)
查看>>
java代码内,获得jsp产生的html
查看>>
jquery.validate remote 和 自定义验证方法
查看>>
hibernate使用sql查询
查看>>
二叉树(2)——遍历的非递归实现
查看>>