Merge branch 'feature/vue'
Showing
6 changed files
with
30 additions
and
1 deletions
.editorconfig
0 → 100644
@@ -31,6 +31,9 @@ iconfont 新建项目,使用 class 控制图标样式,不要用 unicode | @@ -31,6 +31,9 @@ iconfont 新建项目,使用 class 控制图标样式,不要用 unicode | ||
31 | 支持 一个按钮,两个按钮,多个按钮 | 31 | 支持 一个按钮,两个按钮,多个按钮 |
32 | 每个按钮支持自定义事件 | 32 | 每个按钮支持自定义事件 |
33 | 33 | ||
34 | +<h2>Handlebars Template</h2> | ||
35 | +<p>Hello,<span id="hbs-placeholder"></span>!</p> | ||
36 | + | ||
34 | <h2>Vue 示例</h2> | 37 | <h2>Vue 示例</h2> |
35 | 38 | ||
36 | <div id="app"> | 39 | <div id="app"> |
@@ -54,6 +54,7 @@ | @@ -54,6 +54,7 @@ | ||
54 | "gulp-postcss": "^6.1.0", | 54 | "gulp-postcss": "^6.1.0", |
55 | "gulp-sourcemaps": "^2.0.0-alpha", | 55 | "gulp-sourcemaps": "^2.0.0-alpha", |
56 | "gulp-util": "^3.0.7", | 56 | "gulp-util": "^3.0.7", |
57 | + "handlebars-loader": "^1.3.0", | ||
57 | "husky": "^0.11.4", | 58 | "husky": "^0.11.4", |
58 | "nodemon": "1.9.2", | 59 | "nodemon": "1.9.2", |
59 | "postcss-assets": "^4.0.1", | 60 | "postcss-assets": "^4.0.1", |
public/js/example/hello.hbs
0 → 100644
1 | +<span>{{text}}</span> |
1 | +var tpl = require('./hello.hbs'); | ||
2 | + | ||
1 | var Vue = require('yoho-vue'); | 3 | var Vue = require('yoho-vue'); |
2 | 4 | ||
3 | var app = require('example/home.vue'); | 5 | var app = require('example/home.vue'); |
@@ -31,4 +33,11 @@ var test = { | @@ -31,4 +33,11 @@ var test = { | ||
31 | }; | 33 | }; |
32 | } | 34 | } |
33 | }; | 35 | }; |
36 | + | ||
37 | +// Handlebars/HBS 模版例子 | ||
38 | +$('#hbs-placeholder').html(tpl({ | ||
39 | + text: 'Handlerbars' | ||
40 | +})); | ||
41 | + | ||
42 | + | ||
34 | /* eslint-enable */ | 43 | /* eslint-enable */ |
@@ -53,7 +53,10 @@ module.exports = { | @@ -53,7 +53,10 @@ module.exports = { | ||
53 | }, { | 53 | }, { |
54 | test: /\.css$/, | 54 | test: /\.css$/, |
55 | loader: 'style!css?-url' | 55 | loader: 'style!css?-url' |
56 | - }] | 56 | + }, { |
57 | + test: /\.hbs$/, loader: 'handlebars-loader' | ||
58 | + } | ||
59 | + ] | ||
57 | }, | 60 | }, |
58 | resolve: { | 61 | resolve: { |
59 | modulesDirectories: ['node_modules', './vue'] | 62 | modulesDirectories: ['node_modules', './vue'] |
-
Please register or login to post a comment