2
0
mirror of https://github.com/frappe/books.git synced 2025-02-03 04:28:32 +00:00
books/src/main.js

54 lines
1.4 KiB
JavaScript
Raw Normal View History

2018-06-01 18:05:51 +05:30
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
// vue imports
2018-06-26 16:43:05 +05:30
import Vue from 'vue';
import App from './App';
import router from './router';
import frappeVue from 'frappejs/ui/plugins/frappeVue';
// frappejs imports
import frappe from 'frappejs';
2018-07-14 18:45:21 +05:30
import io from 'socket.io-client';
import HTTPClient from 'frappejs/backends/http';
import common from 'frappejs/common';
import coreModels from 'frappejs/models';
import models from '../models';
2018-06-11 16:50:34 +05:30
import registerReportMethods from '../reports';
frappe.init();
frappe.registerLibs(common);
frappe.registerModels(coreModels);
frappe.registerModels(models);
const server = 'localhost:8000';
frappe.fetch = window.fetch.bind();
frappe.db = new HTTPClient({ server });
const socket = io.connect(`http://${server}`);
frappe.db.bindSocketClient(socket);
frappe.getSingle('SystemSettings');
2018-06-26 16:43:05 +05:30
registerReportMethods();
frappe.getSingle('AccountingSettings')
.then(accountingSettings => {
if (router.currentRoute.fullPath !== '/') return;
if (accountingSettings.companyName) {
router.push('/list/ToDo');
} else {
router.push('/setup-wizard');
}
});
window.frappe = frappe;
2018-06-01 18:05:51 +05:30
2018-06-26 16:43:05 +05:30
Vue.config.productionTip = false;
Vue.use(frappeVue);
2018-06-26 16:43:05 +05:30
2018-06-01 18:05:51 +05:30
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
2018-06-26 16:43:05 +05:30
});