ant-design-vue/site/dev.js

56 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-01-12 11:33:27 +08:00
import 'babel-polyfill';
import '../components/style.js';
import './index.less';
import 'highlight.js/styles/solarized-light.css';
import Vue from 'vue';
2019-02-11 22:22:46 +08:00
import Vuex from 'vuex';
2019-01-12 11:33:27 +08:00
import VueI18n from 'vue-i18n';
import VueRouter from 'vue-router';
import VueClipboard from 'vue-clipboard2';
import Md from './components/md';
import Api from './components/api';
import './components';
import demoBox from './components/demoBox';
import demoContainer from './components/demoContainer';
2019-02-18 23:33:39 +08:00
import Test from '../components/test/index.vue';
2019-01-12 11:33:27 +08:00
import zhCN from './theme/zh-CN';
import enUS from './theme/en-US';
2019-02-11 22:22:46 +08:00
Vue.use(Vuex);
2019-01-12 11:33:27 +08:00
Vue.use(VueClipboard);
Vue.use(VueRouter);
Vue.use(VueI18n);
Vue.component(Md.name, Md);
Vue.component(Api.name, Api);
Vue.component('demo-box', demoBox);
Vue.component('demo-container', demoContainer);
2018-06-16 21:47:32 +08:00
2018-11-29 08:52:27 +08:00
const i18n = new VueI18n({
locale: enUS.locale,
messages: {
[enUS.locale]: { message: enUS.messages },
[zhCN.locale]: { message: zhCN.messages },
},
2019-01-12 11:33:27 +08:00
});
2018-11-29 08:52:27 +08:00
2018-06-16 21:47:32 +08:00
const router = new VueRouter({
mode: 'history',
2019-01-12 11:33:27 +08:00
routes: [{ path: '/*', component: Test }],
});
2019-02-11 22:22:46 +08:00
const store = new Vuex.Store({
state: {
username: 'zeka',
},
mutations: {
update(state, payload) {
state.username = payload.username;
},
},
});
2018-06-16 21:47:32 +08:00
new Vue({
el: '#app',
2018-11-29 08:52:27 +08:00
i18n,
2018-06-16 21:47:32 +08:00
router,
2019-02-11 22:22:46 +08:00
store,
2019-01-12 11:33:27 +08:00
});