zoukankan      html  css  js  c++  java
  • pug.compile() will compile the Pug source code into a JavaScript function that takes a data object (called “locals”) as an argument.

    Getting Started – Pug https://pugjs.org/api/getting-started.html

    GitHub - Tencent/wepy: 小程序组件化开发框架 https://github.com/Tencent/wepy

    <template lang="pug">
        view(class='container')
            view(class='userinfo' @tap='tap')
                mycom(:prop.sync='myprop' @fn.user='myevent')
                text {{now}}
    </template>


    多会企业版 - 专属线下活动平台 https://www.duohui.cn/enterprise#features

    Attributes – Pug https://pugjs.org/language/attributes.html

    Here are some alternatives you can use to include variables in your attribute:

    1. Simply write the attribute in JavaScript:

       
      - var url = 'pug-test.html';
      a(href='/' + url) Link
      |
      |
      - url = 'https://example.com/'
      a(href=url) Another link
       
       
      <a href="/pug-test.html">Link</a>
      <a href="https://example.com/">Another link</a>
       
    2. If your JavaScript runtime supports ES2015 template strings (including Node.js/io.js 1.0.0 and later), you can also use its syntax to simplify your attributes:

       
      - var btnType = 'info'
      - var btnSize = 'lg'
      button(type='button' class='btn btn-' + btnType + ' btn-' + btnSize)
      |
      |
      button(type='button' class=`btn btn-${btnType} bt





      Style Attributes 

      The style attribute can be a string, like any normal attribute; but it can also be an object, which is handy when styles are generated by JavaScript.

       
      a(style={color: 'red', background: 'green'})
       
      <a style="color:red;background:green;"></a>
       





  • 相关阅读:
    数据结构-第5章学习小结
    数据结构-第4章学习小结
    数据结构-第3章学习小结
    数据结构-第2章学习小结
    数据结构-第1章学习小结
    实验五 单元测试
    实验四 代码评审
    实验三 UML建模工具的安装和使用
    实验二 结对编程 (第二阶段)
    结对编程实验 第一阶段
  • 原文地址:https://www.cnblogs.com/rsapaper/p/9818833.html
Copyright © 2011-2022 走看看