🌳 The Vue binding for ptero
- Vue 1.x or 2.x
$ npm install vue-ptero --save # for npm users
$ yarn add vue-ptero # for yarn users
const Vue = require('vue')
const VuePtero = require('vue-ptero')
Vue.use(VuePtero, { target: document.body })
new Vue({
el: '#app',
created() {
// listen a custom event
this.$ptero.on('event-xxx', e => {
console.log(e.detail)
})
// emit a custom event
this.$ptero.emit('event-xxx', { foo: 1 })
},
})
First, try to build example projects.
$ git clone https://github.com/emoji-gen/vue-ptero.git
$ cd vue-ptero
$ yarn
$ yarn run example
MIT © Emoji Generator