app.js 678 Bytes
import Vue from 'vue';
import App from './app.vue';
import {createRouter} from './router';
import {createStore} from './store';
import 'filters';
import 'directives';
import titleMixin from './mixins/title';
import pluginCore from './plugins/core';
import lazyload from 'vue-lazyload';

Vue.use(lazyload, {
  preLoad: 2
});
Vue.use(pluginCore);
Vue.mixin(titleMixin);

export function createApp(context) {
  const router = createRouter();
  const store = createStore(context);

  const app = new Vue({
    router,
    store,
    errorCaptured(e) {
      console.log('errorCaptured', e);
      return false;
    },
    render: h => h(App)
  });

  return {app, router, store};
}