ant-design-vue/site/dev.js

56 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-01-12 03:33:27 +00: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 14:22:46 +00:00
import Vuex from 'vuex';
2019-01-12 03:33:27 +00: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';
import Test from '../components/tree/demo/index.vue';
2019-01-12 03:33:27 +00:00
import zhCN from './theme/zh-CN';
import enUS from './theme/en-US';
2019-02-11 14:22:46 +00:00
Vue.use(Vuex);
2019-01-12 03:33:27 +00: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 13:47:32 +00:00
2018-11-29 00:52:27 +00:00
const i18n = new VueI18n({
locale: enUS.locale,
messages: {
[enUS.locale]: { message: enUS.messages },
[zhCN.locale]: { message: zhCN.messages },
},
2019-01-12 03:33:27 +00:00
});
2018-11-29 00:52:27 +00:00
2018-06-16 13:47:32 +00:00
const router = new VueRouter({
mode: 'history',
2019-01-12 03:33:27 +00:00
routes: [{ path: '/*', component: Test }],
});
2019-02-11 14:22:46 +00:00
const store = new Vuex.Store({
state: {
username: 'zeka',
},
mutations: {
update(state, payload) {
state.username = payload.username;
},
},
});
2018-06-16 13:47:32 +00:00
new Vue({
el: '#app',
2018-11-29 00:52:27 +00:00
i18n,
2018-06-16 13:47:32 +00:00
router,
2019-02-11 14:22:46 +00:00
store,
2019-01-12 03:33:27 +00:00
});