Q:

Vue Plugin error - returns not defined

I'm currently exploring Vue JS Plugin and Im trying to create my own plugin, but after I build console returns "GlobalDataMethods is not defined". What am I missing here?
GlobalDataMethods.install = function(Vue, options) {
    Vue.getAPIData = function(paramObj) {

    }

    Vue.getFormData = function(formId) {

    }
}

Vue.use(GlobalDataMethods);

A:

GlobalDataMethods needs to be something. You're adding an install property to GlobalDataMethods, but you never define GlobalDataMethods.
const GlobalDataMethods = {}
GlobalDataMethods.install = ...
Vue.use(GlobalDataMethods)

Consider the VueRouter plugin. The router definition is a class. The install method is added to that class.

