Commit 994161c61064a55732d550fc8313d1934ae0003e
1 parent
fba98272
no message
Showing
8 changed files
with
11 additions
and
17 deletions
src/js/component/datatable.js
| 1 | +var template = require('../../hbs/datatable.hbs'); | ||
| 1 | 2 | ||
| 2 | -var template = require('../../hdbs/datatable.hdbs'); | ||
| 3 | - | ||
| 4 | -var data = [{fullname:"terry"},{fullname:"jack"}]; | 3 | +var data = [{ fullname: "terry" }, { fullname: "jack" }]; |
| 5 | 4 | ||
| 6 | var htmlcontent = template(data); | 5 | var htmlcontent = template(data); |
| 7 | 6 | ||
| 8 | -$('#container').append(htmlcontent).append("数据加载完毕~"); | ||
| 9 | \ No newline at end of file | 7 | \ No newline at end of file |
| 8 | +$('#container').append(htmlcontent).append("数据加载完毕~"); |
src/js/loaddata.js
src/tpl/index.ejs renamed to src/templates/ejs/index.ejs
| 1 | <%- require('./component/header.ejs')() %> | 1 | <%- require('./component/header.ejs')() %> |
| 2 | 2 | ||
| 3 | - <h1>Hello,World!</h1> | ||
| 4 | - <h2>Across the Great Wall ,we can reach every corner in the world~</h2> | ||
| 5 | - <img src="img/embed/1.png" /> | 3 | +<h1>Hello,World!</h1> |
| 4 | +<h2>Across the Great Wall ,we can reach every corner in the world~</h2> | ||
| 5 | +<img src="img/embed/1.png" /> | ||
| 6 | 6 | ||
| 7 | <%- require('./component/footer.ejs')() %> | 7 | <%- require('./component/footer.ejs')() %> |
| 8 | \ No newline at end of file | 8 | \ No newline at end of file |
src/tpl/loaddata.ejs renamed to src/templates/ejs/news.ejs
src/tpl/component/footer.ejs renamed to src/templates/ejs/partial/footer.ejs
src/tpl/component/header.ejs renamed to src/templates/ejs/partial/header.ejs
src/tpl/component/datatable.ejs deleted
100755 → 0
webpack.config.js
| @@ -108,16 +108,16 @@ var config = { | @@ -108,16 +108,16 @@ var config = { | ||
| 108 | extractCSS, | 108 | extractCSS, |
| 109 | // 生成单独html页面(仅仅示例,生成多页面写法不同) | 109 | // 生成单独html页面(仅仅示例,生成多页面写法不同) |
| 110 | new HtmlWebpackPlugin({ | 110 | new HtmlWebpackPlugin({ |
| 111 | - template: path.join(SRC_PATH, 'tpl/') + 'index.ejs', | 111 | + template: path.join(SRC_PATH, 'templates/ejs/') + 'index.ejs', |
| 112 | filename: 'index.html', | 112 | filename: 'index.html', |
| 113 | chunks: ['commons', 'index', 'webpack-dev-server'], | 113 | chunks: ['commons', 'index', 'webpack-dev-server'], |
| 114 | inject: 'body' | 114 | inject: 'body' |
| 115 | }), | 115 | }), |
| 116 | 116 | ||
| 117 | new HtmlWebpackPlugin({ | 117 | new HtmlWebpackPlugin({ |
| 118 | - template: path.join(SRC_PATH, 'tpl/') + 'loaddata.ejs', | ||
| 119 | - filename: 'loaddata.html', | ||
| 120 | - chunks: ['commons', 'loaddata', 'webpack-dev-server'], | 118 | + template: path.join(SRC_PATH, 'templates/ejs/') + 'news.ejs', |
| 119 | + filename: 'news.html', | ||
| 120 | + chunks: ['commons', 'news', 'webpack-dev-server'], | ||
| 121 | inject: 'body' | 121 | inject: 'body' |
| 122 | }) | 122 | }) |
| 123 | ] | 123 | ] |