ibt2/src/main.js

56 lines
1.9 KiB
JavaScript
Raw Normal View History

2017-01-19 22:21:50 +01:00
/*
* I'll be there, 2. An oversimplified application to register attendees at a conference or event.
*
* Copyright 2016-2017 Davide Alberani <da@erlug.linux.it>, RaspiBO <info@raspibo.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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';
2017-01-16 21:06:10 +01:00
import Users from './Users';
2017-01-15 19:07:10 +01:00
import Toolbar from './Toolbar';
2017-01-21 14:36:36 +01:00
import IbtFooter from './IbtFooter';
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-16 21:06:10 +01:00
{path: '/', name: 'home', component: App},
2017-01-15 22:35:54 +01:00
{path: '/day/', name: 'days', component: App},
{path: '/day/:day', name: 'day', component: App},
2017-01-16 21:06:10 +01:00
{path: '/user/', name: 'users', component: Users},
{path: '/user/:id', 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});
var vue = new Vue({
el: '#app',
2017-01-15 22:35:54 +01:00
store: store,
2017-01-21 14:36:36 +01:00
template: '<div id="app"><toolbar /><router-view class="view"></router-view><ibt-footer /></div>',
2017-01-14 11:47:54 +01:00
router: router,
2017-01-21 14:36:36 +01:00
components: { App, Toolbar, IbtFooter, Users, User }
2017-01-14 11:47:54 +01:00
});