yarn add vengine
Currently it depends on Vue, vue-template-compiler and vue-server-renderer, but I do plan to make a standalone template engine that supports Vue template syntax without using these libs.
const vengine = require('vengine')
const template = vengine.compile(`<ul>
<li v-for="item in list">{{ item }}</li>
</ul>`)
template({
list: ['foo', 'bar', 'baz']
}).then(html => {
//=> console.log(html)
<ul data-server-rendered="true">
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
})
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
vengine © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @_egoistlily