hypervue
v0.4.1
Published
Use tagged template string in Vue.js
Downloads
3
Readme
hyperVue
Use tagged template string in Vue.js
Original Project vs Fork
This project is a fork of egoist's
vue-html.
In egoist's vue-html, the key logic is bound to Vue (using Vue.use(HTML)
).
In this version, vue-html is a function which takes in createElement.
Install
$ npm install --save hypervue
Usage
import Vue from 'vue'
import hyperVue from 'hypervue'
new Vue({
el: '#app',
data: {
count: 0
},
methods: {
handleClick() {
this.count++
}
},
render(createElement) {
const html = hyperVue(createElement);
return hyperVue`
<button onClick=${this.handleClick}>${this.count}</button>
`
}
})
Contributing
- 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