Skip to content

Commit

Permalink
Use ES2016 style import for vue
Browse files Browse the repository at this point in the history
  • Loading branch information
cmrd-senya committed Nov 21, 2017
1 parent 761c898 commit 5034e2a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Errors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var _ = require('lodash');
var Vue = require('vue');
import Vue from 'vue'

module.exports = class Errors {
export default class Errors {

constructor(errors) {
this.set(errors);
Expand Down
4 changes: 2 additions & 2 deletions src/Model.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var _ = require('lodash');
var axios = require('axios');
var Vue = require('vue');
import Vue from 'vue'
require('promise.prototype.finally').shim();
require('./lib/promise-delay');

module.exports = class Model {
export default class Model {
constructor(data, settings, classes) {
this.classes = classes;
this.settings = settings;
Expand Down
12 changes: 8 additions & 4 deletions src/VueModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ var _ = require('lodash');
var Bus = require('./PubSub');
var setNested = require('./lib/set-nested');

import Errors from "./Errors.js"
import Model from "./Model.js"
import Defaults from "./Defaults.js"

class VueModel {
constructor() {
this.bus = Bus();
Expand Down Expand Up @@ -145,9 +149,9 @@ class VueModel {
}

this.classes = _.defaults(options.classes, {
model: require('./Model'),
errors: require('./Errors'),
defaults: require('./Defaults'),
model: Model,
errors: Errors,
defaults: Defaults,
});

var registry = _.get(options, 'models', {});
Expand Down Expand Up @@ -195,4 +199,4 @@ class VueModel {
}
}

module.exports = new VueModel();
export default new VueModel();

0 comments on commit 5034e2a

Please sign in to comment.