ye-will / vue-factory

A simple factory/provider extension for Vue.js, like services in Angular.
MIT License
29 stars 2 forks source link

Cannot set property '$Vue' of undefined #2

Closed JCKodel closed 7 years ago

JCKodel commented 7 years ago

On line 26.

25 } else {
26  Provider.$Vue = vm.$Vue
27  plugin.$providers[key] = Provider
28}

Usage: Cordova + WebPack + Framework7-Vue

import VueFactory from "vue-factory";
import DatabaseService from "./services/databaseService";

Vue.use(VueFactory);
Vue.factory.register({ "DatabaseService": DatabaseService });

DatabaseService is a sample:

import superagent from "superagent";

export class DatabaseService
{
    constructor()
    {
        this.const = "Not editable";
    }

    echo(something)
    {
        console.log(something + " (" + this.value + ")");
    }

    get prop()
    {
        return `get: ${this.value}`;
    }

    set prop(value)
    {
        this.value = value;
    }
}
JCKodel commented 7 years ago

The problem was here:

export **default** class DatabaseService