vue inline handler

by Simon Boddy

HTML

<div id="vueRoot">
  <my-custom-component @saved="data => variable = data"></my-custom-component>{{variable}}
</div>

JavaScript

Vue.component('my-custom-component',{
	template : `<button @click='$emit("saved",{message : "hello cobber"})'>Click me !</button>`
})

vm = new Vue({
	el : '#vueRoot',
  data : { variable : null }
})