add site
parent
18efe2729d
commit
06d1e63fdf
11
.travis.yml
11
.travis.yml
|
@ -1,16 +1,7 @@
|
|||
language: node_js
|
||||
sudo: required
|
||||
node_js:
|
||||
- 8.2.1
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
deploy:
|
||||
provider: pages
|
||||
skip-cleanup: true
|
||||
keep-history: true
|
||||
on:
|
||||
branch: master
|
||||
- 8.2.1
|
||||
script:
|
||||
- bash ./scripts/deploy-to-gh-pages.sh
|
||||
env:
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<template>
|
||||
<div>
|
||||
<Components/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Menu } from 'antd'
|
||||
export default {
|
||||
data () {
|
||||
console.log('routes', this.$route.params)
|
||||
return {}
|
||||
},
|
||||
components: {
|
||||
Menu,
|
||||
'Components': () => {
|
||||
console.log(this.$route)
|
||||
const { name, demo } = this.$route.params
|
||||
return import(`../components/${name}/demo/index.vue`)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
|
@ -8,7 +8,7 @@ Vue.use(VueRouter)
|
|||
Vue.component(Md.name, Md)
|
||||
|
||||
const router = new VueRouter({
|
||||
mode: 'history',
|
||||
mode: 'hash',
|
||||
routes,
|
||||
})
|
||||
new Vue({
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import Demo from './demo'
|
||||
const AsyncComp = () => {
|
||||
const pathnameArr = window.location.pathname.split('/')
|
||||
const com = pathnameArr[1] || 'button' // eslint-disable-line
|
||||
|
@ -7,5 +8,6 @@ const AsyncComp = () => {
|
|||
}
|
||||
}
|
||||
export default [
|
||||
{ path: '/*', component: AsyncComp },
|
||||
{ path: '/components/:name/:demo?', component: Demo },
|
||||
// { path: '/*', component: AsyncComp },
|
||||
]
|
||||
|
|
|
@ -18,7 +18,7 @@ cd dist
|
|||
git init
|
||||
git add -f .
|
||||
git commit -m "Travis build"
|
||||
git push --force --quiet https://${GITHUB_TOKEN}@github.com/vueComponent/ant-design.git master:gh-pages > /dev/null
|
||||
git push --force --quiet "https://${GITHUB_TOKEN}@github.com/vueComponent/ant-design.git" master:gh-pages > /dev/null
|
||||
|
||||
|
||||
echo "Done updating gh-pages\n"
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
import 'antd/style.js'
|
||||
import './index.less'
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import routes from './routes'
|
||||
import Md from './md'
|
||||
Vue.use(VueRouter)
|
||||
Vue.component(Md.name, Md)
|
||||
|
||||
const router = new VueRouter({
|
||||
mode: 'hash',
|
||||
routes,
|
||||
})
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
})
|
|
@ -0,0 +1,3 @@
|
|||
#app {
|
||||
padding: 50px;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<template>
|
||||
<div style="padding: 10px 0;" v-html="marked($slots.default[0].text.trim() || '')" />
|
||||
</template>
|
||||
<script>
|
||||
import marked from 'marked'
|
||||
marked.setOptions({
|
||||
renderer: new marked.Renderer(),
|
||||
gfm: true,
|
||||
tables: true,
|
||||
breaks: false,
|
||||
pedantic: true,
|
||||
sanitize: true,
|
||||
smartLists: true,
|
||||
smartypants: true,
|
||||
})
|
||||
export default {
|
||||
name: 'md',
|
||||
data () {
|
||||
return {
|
||||
marked,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,11 @@
|
|||
const AsyncComp = () => {
|
||||
const pathnameArr = window.location.pathname.split('/')
|
||||
const com = pathnameArr[1] || 'button' // eslint-disable-line
|
||||
const demo = pathnameArr[2] || 'index'
|
||||
return {
|
||||
component: import(`../components/card/demo/${demo}.vue`),
|
||||
}
|
||||
}
|
||||
export default [
|
||||
{ path: '/*', component: AsyncComp },
|
||||
]
|
Loading…
Reference in New Issue