Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
[types.SYNC_ADD_TASK] (state, task) {
const tasksCollection = Vue.prototype.$db.syncTaskCollection
task = _prepareTask(task)
tasksCollection.setItem(task.task_id.toString(), task, (err, resp) => {
if (err) console.error(err)
Vue.prototype.$bus.$emit('sync/PROCESS_QUEUE', { config: rootStore.state.config }) // process checkout queue
Logger.info('Request added to sync queue: '+ task.url, { tag: 'sync', context: { label: 'Task ID', value: task.task_ud }})
}).catch((reason) => {
console.error(reason) // it doesn't work on SSR
})
}
}
import 'nprogress/nprogress.css'
import nprogress from 'nprogress'
import 'animate.css/animate.css'
import bsComponents from './components'
import api from './api'
if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.config.productionTip = false
Wavas.init()
Vue.swal = Vue.prototype.$swal = swal
Vue.nprogress = Vue.prototype.$nprogress = nprogress
Vue.api = Vue.prototype.$api = api
Vue.store = store
Vue.use(BootstrapVue)
Vue.use(bsComponents)
/* eslint-disable no-new */
const vue = new Vue({
components: { App },
router,
store,
template: ''
}).$mount('#app')
Vue.eventBus = Vue.prototype.$eventBus = vue
import VueAxios from "vue-axios";
import axios from "assets/axios";
import "root/node_modules/iview/dist/styles/iview.css";
// vuex
Vue.use(Vuex);
Vue.use(VueAxios, axios);
// 按需引入iview组件
import { Button, Form, Input, Icon, Message } from "iview";
Vue.component("Form", Form);
Vue.component("FormItem", Form.Item);
Vue.component("Input", Input);
Vue.component("Button", Button);
Vue.component("Icon", Icon);
Vue.prototype.$Message = Message;
window.$Message = Message;
// init vuex
const store = new Vuex.Store(stores);
Vue.config.debug = true;
// init vue
new Vue({
el: "#app",
template: "",
components: { App },
store
});
const NotificationComponent = Vue.extend(Notification)
const openNotification = (propsData = {
title: '',
message: '',
type: '',
direction: '',
duration: 4500,
container: '.notifications'
}) => {
return new NotificationComponent({
el: document.createElement('div'),
propsData
})
}
Vue.prototype.$notify = openNotification
function handleError (error) {
// if the server gave a response message, print that
if (error.response) {
// duration should be proportional to the error message length
openNotification({
title: 'Error: ' + error.response.status,
message: error.response.data,
type: 'danger'
})
} else if (error.request) {
openNotification({
title: 'Error: No response received!',
message: 'Please verify if the backend is running!',
type: 'danger'
})
import Vue from 'vue';
Vue.config.productionTip = false;
/* eslint-disable */
Vue.prototype.$route = window.route;
Vue.prototype.$events = new Vue();
/* eslint-enable */
import 'swiper/dist/css/swiper.css';
import VueLazyload from 'vue-lazyload'
Vue.component(DatetimePicker.name, DatetimePicker);
Vue.component(Switch.name, Switch);
if (config.MOCK_ENABLE) {
require('./data');//加载mock
}
require('./style/my-mint.scss');
Vue.use(Mint);
Vue.config.productionTip = false;
Vue.prototype.BaseApi = BaseApi;//将BaseApi挂载在Vue中
Vue.prototype.commonUtils = commonUtils;//将commonUtils挂载在Vue中
Vue.prototype.$config = config;//将config挂载在Vue中
Vue.prototype.$messageBox = MessageBox;//弹窗挂载
Vue.prototype.$toast = Toast;//Toast挂载
Vue.use(VueLazyload);
new Vue({
el: '#app',
router,
store,
components: {App},
template: ''
});
function clipboardSuccess() {
Vue.prototype.$message({
message: '复制成功',
type: 'success',
duration: 1500,
})
}
import '@babel/polyfill'
import 'mutationobserver-shim'
import Vue from 'vue'
import './plugins/bootstrap-vue'
import App from './App.vue'
import store from './store'
Vue.config.productionTip = false
new Vue({
store,
render: h => h(App),
}).$mount('#app')
const freqgen = require('../../freqgen-core')
Object.defineProperty(Vue.prototype, '$freqgen', { value: freqgen })
import Vue from 'vue'
import axios from 'axios'
import router from './router'
import store from './store'
import { sync } from 'vuex-router-sync'
import App from 'components/app-root'
Vue.prototype.$http = axios;
sync(store, router)
const app = new Vue({
store,
router,
...App
})
export {
app,
router,
store
}