diff --git a/package.json b/package.json index 5fff0e8c5..9ef945bc2 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "es" ], "scripts": { + "dev": "NODE_ENV=development ENTRY_INDEX=dev ./node_modules/.bin/webpack-dev-server --open --hot --port 3001", "start": "NODE_ENV=development ./node_modules/.bin/webpack-dev-server --open --hot", "test": "jest --config .jest.js", "site": "node scripts/run.js site-dist", @@ -136,11 +137,13 @@ "vue": "^2.5.16", "vue-antd-md-loader": "^1.0.3", "vue-clipboard2": "0.0.8", + "vue-infinite-scroll": "^2.0.2", "vue-jest": "^2.5.0", "vue-loader": "^13.0.5", "vue-router": "^3.0.1", "vue-server-renderer": "^2.5.16", "vue-template-compiler": "^2.5.16", + "vue-virtual-scroller": "^0.12.0", "webpack": "^3.11.0", "webpack-chunk-hash": "^0.5.0", "webpack-dev-server": "^2.8.2", @@ -166,4 +169,4 @@ "shallowequal": "^1.0.2", "warning": "^3.0.0" } -} +} \ No newline at end of file diff --git a/site/dev.js b/site/dev.js new file mode 100644 index 000000000..36ff263d6 --- /dev/null +++ b/site/dev.js @@ -0,0 +1,31 @@ +import 'babel-polyfill' +import '../components/style.js' +import './index.less' +import 'highlight.js/styles/solarized-light.css' +import Vue from 'vue' +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/list/demo/index' + +Vue.use(VueClipboard) +Vue.use(VueRouter) +Vue.component(Md.name, Md) +Vue.component(Api.name, Api) +Vue.component('demo-box', demoBox) +Vue.component('demo-container', demoContainer) + +const router = new VueRouter({ + mode: 'history', + routes: [ + { path: '/*', component: Test }, + ], +}) +new Vue({ + el: '#app', + router, +}) diff --git a/site/routes.js b/site/routes.js index b66e530cd..94936ac46 100644 --- a/site/routes.js +++ b/site/routes.js @@ -1,13 +1,6 @@ import Layout from './components/layout.vue' import Iframe from './components/iframe.vue' -const AsyncTestComp = () => { - const d = window.location.hash.replace('#', '') - return { - component: import(`../components/input-number/demo/${d}`), - } -} - export default [ { path: '/ant-design/components/:name/', component: Layout, props: true }, { path: '/ant-design/iframe/:name/', component: Iframe, props: true }, @@ -70,7 +63,5 @@ export default [ { path: '', redirect: '/ant-design/vue/docs/introduce/' }, ], }, - - { path: '/:prefix?/test/:demo?/', component: AsyncTestComp }, { path: '/*', redirect: '/ant-design/docs/vue/introduce/' }, ] diff --git a/webpack.base.config.js b/webpack.base.config.js index 7c45b8181..4320816f1 100644 --- a/webpack.base.config.js +++ b/webpack.base.config.js @@ -133,7 +133,7 @@ md.core.ruler.push('update_template', function replace ({ tokens }) { module.exports = { entry: { index: [ - './site/index.js', + `./site/${process.env.ENTRY_INDEX || 'index'}.js`, ], }, module: {