zoukankan      html  css  js  c++  java
  • js 字符串拼接 html 累加 html 叠加

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

    //页面层
                layer.open({
                        type: 1,
                        content:`<div class="child_card">
                                    <div class="mui-card-content ">
                                        <div class="mui-row ">
                                            <div class="mui-col-xs-12 ">
                                                <ul class="mui-table-view ">
                                                    <li class="mui-table-view-cell "><i class="icon iconfont">&#xe60c;</i> 穿衣 [${this.life.chuanyi[0]}]:<p style="margin: 15px;    word-break: break-all;">${this.life.chuanyi[1]}</p></li>
                                                    <li class="mui-table-view-cell ">  <i class="icon iconfont">&#xe60a;</i> 感冒 [${this.life.ganmao[0]}]:<p style="margin: 15px;    word-break: break-all;">${this.life.ganmao[1]}</p></li>
                                                    <li class="mui-table-view-cell "><i class="icon iconfont">&#xe60d;</i> 运动 [${this.life.yundong[0]}]:<p style="margin: 15px;    word-break: break-all;">${this.life.yundong[1]}</p></li>
                                                    <li class="mui-table-view-cell "><i class="icon iconfont">&#xe609;</i> 空调 [${this.life.kongtiao[0]}]:<p style="margin: 15px;    word-break: break-all;">${this.life.kongtiao[1]}</p></li>
                                                    <li class="mui-table-view-cell "> <i class="icon iconfont">&#xe60b;</i> 紫外线 [${this.life.ziwaixian[0]}]:<p style="margin: 15px;    word-break: break-all;">${this.life.ziwaixian[1]}</p></li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>`
    });

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

      var panelBuffer = '<div class="mui-poppicker">
            <div class="mui-poppicker-header">
                <button class="mui-btn mui-poppicker-btn-cancel">取消</button>
                <button class="mui-btn mui-btn-blue mui-poppicker-btn-ok">确定</button>
                <div class="mui-poppicker-clear"></div>
            </div>
            <div class="mui-poppicker-body">
            </div>
        </div>';
    
        var pickerBuffer = '<div class="mui-picker">
            <div class="mui-picker-inner">
                <div class="mui-pciker-rule mui-pciker-rule-ft"></div>
                <ul class="mui-pciker-list">
                </ul>
                <div class="mui-pciker-rule mui-pciker-rule-bg"></div>
            </div>
        </div>';
  • 相关阅读:
    22天学习java基础笔记之day08
    22天学习java基础笔记之day07
    22天学习java基础笔记之day06
    22天学习java基础笔记之day05
    架构师_设计模式_行为型_迭代器
    架构师_设计模式_行为型_命令模式
    架构师_设计模式_行为型_责任链模式
    架构师_设计模式_行为型_模板方法
    架构师_设计模式_结构型_装饰器模式
    架构师_设计模式_结构型_桥接模式
  • 原文地址:https://www.cnblogs.com/CyLee/p/5992673.html
Copyright © 2011-2022 走看看