Skip to content

Instantly share code, notes, and snippets.

@oozman
Created August 27, 2017 16:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oozman/1ebae6430c296236bcc1dfac461a3cf8 to your computer and use it in GitHub Desktop.
Save oozman/1ebae6430c296236bcc1dfac461a3cf8 to your computer and use it in GitHub Desktop.
on-load vue component
Vue.component('onload', {
props: [],
template: '<span></span>',
created: function () {
this.load();
},
methods: {
load() {
this.$emit('load')
}
}
});
// <onload v-on:load="someFunction()"></onload>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment