ibt2/src/main.js

51 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-01-02 21:52:33 +01:00
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
2017-01-14 11:47:54 +01:00
import Vue from 'vue';
2017-01-15 22:35:54 +01:00
import Vuex from 'vuex';
2017-01-14 11:47:54 +01:00
import VueRouter from 'vue-router';
import VueResource from 'vue-resource';
import VueMaterial from 'vue-material';
import 'vue-material/dist/vue-material.css';
import 'roboto-fontface/css/roboto/roboto-fontface.css';
import 'material-design-icons/iconfont/material-icons.css';
import jQuery from 'jquery';
2017-01-15 22:35:54 +01:00
import store_data from './store.js';
2017-01-14 11:47:54 +01:00
import App from './App';
2017-01-15 19:07:10 +01:00
import User from './User';
import Toolbar from './Toolbar';
2017-01-02 21:52:33 +01:00
2017-01-15 22:35:54 +01:00
Vue.use(Vuex);
2017-01-14 11:47:54 +01:00
Vue.use(VueRouter);
2017-01-02 21:52:33 +01:00
Vue.use(VueResource);
2017-01-14 11:47:54 +01:00
Vue.use(VueMaterial);
2017-01-02 21:52:33 +01:00
2017-01-14 11:47:54 +01:00
var routes = [
2017-01-15 22:35:54 +01:00
{path: '/', name: 'root', component: App},
{path: '/day/', name: 'days', component: App},
{path: '/day/:day', name: 'day', component: App},
{path: '/user/:user', name: 'user', component: User}
2017-01-14 11:47:54 +01:00
];
2017-01-15 22:35:54 +01:00
const store = new Vuex.Store(store_data);
2017-01-14 11:47:54 +01:00
const router = new VueRouter({routes});
2017-01-15 22:35:54 +01:00
const store2 = new Vuex.Store({
state: {
count: 0
},
mutations: {
increment (state) {
state.count++;
}
}
});
2017-01-14 11:47:54 +01:00
var vue = new Vue({
el: '#app',
2017-01-15 22:35:54 +01:00
store: store,
2017-01-15 19:07:10 +01:00
template: '<div id="app"><Toolbar /><router-view class="view"></router-view></div>',
2017-01-14 11:47:54 +01:00
router: router,
2017-01-15 19:07:10 +01:00
components: { App, Toolbar, User }
2017-01-14 11:47:54 +01:00
});