https://github.com/thinkjs/think-template-handlebars
handlebars template adapter for ThinkJS 2.x
https://github.com/thinkjs/think-template-handlebars
Last synced: about 1 year ago
JSON representation
handlebars template adapter for ThinkJS 2.x
- Host: GitHub
- URL: https://github.com/thinkjs/think-template-handlebars
- Owner: thinkjs
- License: mit
- Created: 2015-11-08T05:56:19.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-12-27T06:17:24.000Z (over 6 years ago)
- Last Synced: 2025-04-03T00:01:37.497Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# think-template-handlebars
handlebars template adapter for `ThinkJS 2.x`
## Install
```sh
npm install think-template-handlebars
```
## How to use
### register adapter
```js
import HandlebarseAdapter from 'think-template-handlebars';
think.adapter('template', 'handlebars', HandlebarseAdapter);
```
add above code in bootstrap file, like `src/common/boostrap/adapter.js`.
### change view type
change view type in file `src/common/config/view.js`,
```js
export default {
type: 'handlebars',
adapter: {
handlebars: { //handlebars options
}
}
}
```
### precompiled
you can precompile handlebars template before deployed. it will auto identified when render template.