1.父页面

<html>

<head>
<meta charset="UTF-8">
<title>我的音乐</title>
<!--加载资源包-->
{{include '../particles/link.html'}}
</head> <body>
<!--引入头部-->
{{include '../particles/header.html'}}
<!--中间留坑--> {{block 'content'}}{{/block}}
<!--引入底部-->
{{include '../particles/footer.html'}} </body> </html>

2.子页面

{{extend './layout/main.html'}}
{{block 'content'}}
<div class="container">
<form id="form" method="post" action="/">
<div class="form-group">
<label for="">歌曲编号</label>
<input type="text" name="id" class="form-control" placeholder="请输入歌曲编号">
</div>
<div class="form-group">
<label for="">歌曲标题</label>
<input type="text" name="title" class="form-control" placeholder="请输入歌曲标题">
</div>
<div class="form-group">
<label for="">歌曲时长</label>
<input type="text" name="time" class="form-control" placeholder="请输入歌曲时长">
</div>
<div class="form-group">
<label for="">歌手</label>
<input type="text" name="singer" class="form-control" placeholder="请输入歌手姓名">
</div>
<div class="form-group">
<label for="">歌曲文件</label>
<input type="file" name="file">
<p class="help-block">请上传歌曲文件.</p>
</div>
<button type="submit" class="btn btn-success">点击添加</button>
</form>
</div>
{{/block}}

3. 拆分的页面

footer.html

<div class="aw-footer-wrap">
<div class="aw-footer">
Copyright © , All Rights Reserved
</div>
</div>

header.html

<div class="aw-footer-wrap">
<div class="aw-footer">
Copyright © , All Rights Reserved
</div>
</div>

link.html

<link href="/public/img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="/public/vender/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/public/css/icon.css" />
<link href="/public/css/common.css" rel="stylesheet" type="text/css" />
<link href="/public/css/link.css" rel="stylesheet" type="text/css" />
<link href="/public/css/style.css" rel="stylesheet" type="text/css" />
<script src="/public/vender/jquery/dist/jquery.js" type="text/javascript"></script>
<script src="/public/vender/bootstrap/dist/js/bootstrap.js"></script>

效果:

koa-artTemplate 的使用的更多相关文章

  1. koa art-template模板引擎的使用

    art-template 模板引擎介绍 art-template 是一个简约.超快的模板引擎. 它采用作用域预声明的技术来优化模板渲染速度,从而获得接近 JavaScript 极限的运行 性能,并且同 ...

  2. koa 基础(二十六)数据库 与 art-template 模板 联动 --- 编辑数据、删除数据

    1.通过 ObjectID 获取 _id 根目录/module/db.js /** * DB库 */ var MongoDB = require('mongodb'); var MongoClient ...

  3. koa 基础(二十五)数据库 与 art-template 模板 联动 --- 新增数据

    1.视图层 根目录/views/index.html <!DOCTYPE html> <html lang="en"> <head> <m ...

  4. js模板引擎art-template使用方法

    art-template是款性能卓越的 js 模板引擎 https://aui.github.io/art-template/ 特性 拥有接近 JavaScript 渲染极限的的性能 调试友好:语法. ...

  5. koa 搭建模块化路由/层级路由

    搭建node项目目录以及基本的文件 初始化package.json文件 执行下面命令生成package.json文件 npm init --yes 创建项目目录 创建路由目录routes,存放静态资源 ...

  6. koa 基础(十三)koa-art-template 模板引擎的使用

    1.项目目录 2.app.js /** * http://aui.github.io/art-template/koa/ * 1.npm install --save art-template * n ...

  7. artTemplate模版引擎的使用

    artTemplate: template.js 一款 JavaScript 模板引擎,简单,好用.提供一套模板语法,用户可以写一个模板区块,每次根据传入的数据,生成对应数据产生的HTML片段,渲染不 ...

  8. koa2入门--09.art-template高速模板引擎的使用

    首先在项目文件夹下使用 cmd,输入:npm install --save art-template koa-template art-template语法参考:http://aui.github.i ...

  9. Node.js实现RESTful api,express or koa?

    文章导读: 一.what's RESTful API 二.Express RESTful API 三.KOA RESTful API 四.express还是koa? 五.参考资料 一.what's R ...

  10. 性能卓越的js模板引擎--artTemplate

    artTemplate能够将数据与View视图的分离,充分利用 javascript 引擎特性,使得其性能无论在前端还是后端都有极其出色的表现. 在 chrome 下渲染效率测试中分别是知名引擎 Mu ...

随机推荐

  1. Nginx 常用基础模块

    目录 Nginx 常用基础模块 Nginx日志管理 nginx日志切割 Nginx目录索引 Nginx状态监控 Nginx访问控制 Nginx访问限制 Nginx 请求限制配置实战 Nginx Loc ...

  2. Linux查询Java进程以及杀掉其进程

    今天公司VPN掉线后,访问项目出错502. 百度了说是nginx代理错误,但入职不久不知道咋搞... 于是乎就想重启一下Java应用. 1.找到Java应用的进程 jps 命令    和   ps - ...

  3. c++后台开发面试常见知识点总结(六)算法手写

    链表倒转  leetcode-206 连续子数组最大和问题(和最大的连续子序列的和)   leetcode-53 输出字符串中最长的回文子串长度?  leetcode-5 一个字符串,求最长无重复子串 ...

  4. 执行cython文件

    找到目录下的setup.py文件 cd到工程目录下: 执行 python3 setup.py build_ext --inplace

  5. 使用springBoot完成阿里云短信验证

    <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot ...

  6. PHP curl_multi_select函数

    curl_multi_select — 等待所有cURL批处理中的活动连接 说明 int curl_multi_select ( resource $mh [, float $timeout = 1. ...

  7. hdu 3974 Assign the task (线段树+树的遍历)

    Description There is a company that has N employees(numbered from 1 to N),every employee in the comp ...

  8. UVALive 3902 Network (树+dfs)

    Consider a tree network with n nodes where the internal nodes correspond to servers and the terminal ...

  9. jdbc 事物 commit 和rollback方法

    package transaction; import jdbc.utils.*; import java.sql.Connection; import java.sql.PreparedStatem ...

  10. MySQL 小数处理函数 round 和 floor

    一. 在mysql中,round函数用于数据的四舍五入,它有两种形式: 1.round(x,d)  ,x指要处理的数,d是指保留几位小数 这里有个值得注意的地方是,d可以是负数,这时是指定小数点左边的 ...