zoukankan      html  css  js  c++  java
  • Vue 备

    <div id="app">

      <span :class='{red:addClass}'>jam</span>

    </div>

    <script>

    window.onload = function(){

    let obj = {addClass:true};

    var app = new Vue({
    el: "#app",
    data:obj,
    render(createElement){
    /*createElement函数 createElement(标签名,[数据对象],子元素)*/
    /*返回输出一createElement的内容*/
    return createElement(
    /*元素对象,{可以增加多个数据对象} on:{绑定事件} */
    "ul",{
    class:{red:true},
    style:{fontSize:"30px"},
    attrs:{abc:"jam"},
    /*当增加domProps数据对象时,[]里的数组内容将不会显示*/
    domProps:{innerHTML:"我是innerHtml"}
    },
    /*[]为数组的内容*/
    [createElement("li",1),createElement("li",2)]
    );
    }
    });
    }

    </script>

  • 相关阅读:
    @codeforces
    @codeforces
    @hdu
    @hdu
    @bzoj
    @bzoj
    @topcoder
    推荐系统主题相关资料
    Python统计百分比及排序
    如何发布及部署asp.net网站
  • 原文地址:https://www.cnblogs.com/JamyWong/p/7681836.html
Copyright © 2011-2022 走看看