Created
July 11, 2020 22:16
-
-
Save getJv/25ca0db2d558180fdd09fec9dbbce6d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const customMethods = { | |
install(Vue) { | |
// INSTALL | |
if (this.installed) return; | |
this.installed = true; | |
Vue.options = Vue.util.mergeOptions(Vue.options, { | |
created: function() { | |
if (this.$options.customMethod) { | |
// If found in the component. | |
this.$options.customMethod(); // Execute the customMethod. | |
} | |
}, | |
}); | |
}, | |
}; | |
export default customMethods; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment