ant-design-vue/examples/index.js

37 lines
905 B
JavaScript
Raw Normal View History

2017-11-03 10:46:18 +00:00
import 'antd/style.js'
2017-10-26 07:18:08 +00:00
import './index.less'
2018-01-23 10:55:39 +00:00
import 'highlight.js/styles/solarized-light.css'
2017-11-03 04:04:39 +00:00
import Vue from 'vue'
import VueRouter from 'vue-router'
2018-01-25 08:29:23 +00:00
import VueClipboard from 'vue-clipboard2'
2017-11-03 04:04:39 +00:00
import routes from './routes'
2018-01-24 07:39:21 +00:00
import Md from './components/md'
import Api from './components/api'
2018-01-23 10:55:39 +00:00
import * as Components from '../components/index'
import demoBox from './components/demoBox'
2018-01-25 08:29:23 +00:00
Vue.use(VueClipboard)
2017-11-03 04:04:39 +00:00
Vue.use(VueRouter)
2017-12-15 04:12:34 +00:00
Vue.component(Md.name, Md)
2018-01-24 07:39:21 +00:00
Vue.component(Api.name, Api)
2018-01-23 10:55:39 +00:00
Vue.component('demo-box', demoBox)
Object.keys(Components).forEach(k => {
2018-02-06 07:21:13 +00:00
if (k === 'api') {
Object.keys(Components[k]).forEach(api => {
Vue.prototype[`$${api}`] = Components[k][api]
})
} else {
const name = `a${k.replace(/([A-Z])/g, '-$1').toLowerCase()}`
Vue.component(name, Components[k])
}
2018-01-23 10:55:39 +00:00
})
2017-11-03 04:04:39 +00:00
const router = new VueRouter({
2018-01-22 10:56:58 +00:00
mode: 'hash',
2017-11-03 04:04:39 +00:00
routes,
})
2017-10-26 07:18:08 +00:00
new Vue({
el: '#app',
2017-11-03 04:04:39 +00:00
router,
2017-10-26 07:18:08 +00:00
})