Skip to content

Commit f179fec

Browse files
自动化测试
1 parent 3ff8e21 commit f179fec

File tree

1,370 files changed

+13707
-194960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,370 files changed

+13707
-194960
lines changed

11-nodejs/koa2/.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
{
2+
"git.ignoreLimitWarning": true
23
}

11-nodejs/koa2/3-koa-mvc/static-files.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

11-nodejs/koa2/3-koa-mvc/views/base.html

Lines changed: 0 additions & 49 deletions
This file was deleted.

11-nodejs/koa2/3-koa-mvc/views/index.html

Lines changed: 0 additions & 80 deletions
This file was deleted.

11-nodejs/koa2/2-koa/03-views.js renamed to 11-nodejs/koa2/3-nunjucks/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/**
22
* nunjucks模板引擎
33
*/
4-
// $ npm install nunjucks --save-dev
4+
// $ npm install nunjucks --save
55

66
const nunjucks = require('nunjucks');
77

8+
// 模板引擎对象
89
function createEnv(path, opts) {
910
var
11+
// 给每个参数加上默认值
1012
autoescape = opts.autoescape === undefined ? true : opts.autoescape,
1113
noCache = opts.noCache || false,
1214
watch = opts.watch || false,
@@ -15,10 +17,9 @@ function createEnv(path, opts) {
1517
env = new nunjucks.Environment(
1618
// 从views目录读取模板
1719
new nunjucks.FileSystemLoader(path, {
18-
// 模板文件最多读取一次,就会放在内存中,开发环境可以关闭cache
1920
noCache: noCache,
2021
watch: watch,
21-
}), {
22+
}),{
2223
autoescape: autoescape,
2324
throwOnUndefined: throwOnUndefined
2425
});
@@ -44,7 +45,6 @@ var s = env.render('hello.html', {
4445
fruits: ['Apple', 'Pear', 'Banana'],
4546
count: 12000
4647
});
47-
4848
console.log(s);
4949

5050
console.log(env.render('extend.html', {

0 commit comments

Comments
 (0)