diff --git a/.babelrc b/.babelrc
index 17e739933..e2f43ba0f 100644
--- a/.babelrc
+++ b/.babelrc
@@ -2,6 +2,7 @@
"presets": ["env"],
"plugins": [
"transform-vue-jsx",
- "transform-object-rest-spread"
+ "transform-object-rest-spread",
+ "syntax-dynamic-import"
]
}
diff --git a/.eslintrc b/.eslintrc
index acd24c6e4..acc3aeff6 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,4 +1,5 @@
{
+ "parser": "babel-eslint",
"extends": ["plugin:vue-libs/recommended"], // ,"plugin:vue-libs/recommended"
"rules": {
"comma-dangle": [2, "always-multiline"],
diff --git a/components/button/demo/basic.vue b/components/button/demo/basic.vue
new file mode 100644
index 000000000..065e842df
--- /dev/null
+++ b/components/button/demo/basic.vue
@@ -0,0 +1,17 @@
+
+
+
Primary
+
Default
+
Dashed
+
Danger
+
+
+
diff --git a/components/button/demo/button.vue b/components/button/demo/button.vue
new file mode 100644
index 000000000..a1545a162
--- /dev/null
+++ b/components/button/demo/button.vue
@@ -0,0 +1,96 @@
+
+
+
+ primary
+
+
Default
+
Dashed
+
Danger
+
+
+
Search
+
+
Search
+
+
+
Search
+
+
Search
+
+
Primary
+
Primary(disabled)
+
+
Default
+
Default(disabled)
+
+
Ghost
+
Ghost(disabled)
+
+
Dashed
+
Dashed(disabled)
+
+
+
Primary
+
Default
+
Dashed
+
danger
+
+
+
+ Loading
+
+
+ Loading
+
+
+
+ Click me!
+
+
+ Click me!
+
+
+
+
+
+
+
+ Cancel
+ OK
+
+
+ L
+ M
+ R
+
+
+ L
+ M
+ M
+ R
+
+
+
+
+
diff --git a/components/index.js b/components/index.js
index d9aaf5ec4..c4a39dcf3 100644
--- a/components/index.js
+++ b/components/index.js
@@ -1,11 +1,3 @@
-import './button/style'
-import './checkbox/style'
-import './icon/style'
-import './radio/style'
-import './grid/style'
-import './tooltip/style'
-import './rate/style'
-
export { default as Button } from './button'
export { default as Checkbox } from './checkbox'
diff --git a/examples/button.vue b/examples/button.vue
index f3c007fc7..edfc45114 100644
--- a/examples/button.vue
+++ b/examples/button.vue
@@ -73,7 +73,7 @@
diff --git a/examples/index.js b/examples/index.js
index 515820e53..4048dc6cc 100644
--- a/examples/index.js
+++ b/examples/index.js
@@ -1,31 +1,14 @@
-import Vue from 'vue'
-import Checkbox from './checkbox.vue'
-import Button from './button.vue'
-import Radio from './radio.vue'
-import Grid from './grid.vue'
-import ToolTip from './tooltip.vue'
-// import Dialog from './dialog.vue'
-import Rate from './rate.vue'
import './index.less'
+import Vue from 'vue'
+import VueRouter from 'vue-router'
+import routes from './routes'
+Vue.use(VueRouter)
+
+const router = new VueRouter({
+ mode: 'history',
+ routes,
+})
new Vue({
el: '#app',
- template: `
-
- `,
- components: {
- AntButton: Button,
- // AntDialog: Dialog,
- Checkbox,
- Grid,
- Radio,
- ToolTip,
- Rate,
- },
+ router,
})
diff --git a/examples/routes.js b/examples/routes.js
new file mode 100644
index 000000000..c9304af3b
--- /dev/null
+++ b/examples/routes.js
@@ -0,0 +1,11 @@
+const AsyncComp = () => {
+ const pathnameArr = window.location.pathname.split('/')
+ const com = pathnameArr[1] || 'button'
+ const demo = pathnameArr[2] || 'basic'
+ return {
+ component: import(`../components/${com}/demo/${demo}.vue`),
+ }
+}
+export default [
+ { path: '/*', component: AsyncComp },
+]
diff --git a/package.json b/package.json
index aa4cff6eb..af39ed717 100644
--- a/package.json
+++ b/package.json
@@ -28,9 +28,11 @@
],
"devDependencies": {
"babel-cli": "^6.26.0",
+ "babel-eslint": "^8.0.1",
"babel-helper-vue-jsx-merge-props": "^2.0.2",
"babel-loader": "^7.1.2",
"babel-plugin-istanbul": "^4.1.1",
+ "babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
@@ -66,6 +68,7 @@
"stylelint-config-standard": "^17.0.0",
"vue": "^2.4.4",
"vue-loader": "^13.0.5",
+ "vue-router": "^3.0.1",
"vue-template-compiler": "^2.4.4",
"webpack": "^3.6.0",
"webpack-dev-server": "^2.8.2"
diff --git a/webpack.config.js b/webpack.config.js
index d07132861..fbae8e042 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -48,6 +48,7 @@ module.exports = {
extensions: ['.js', '.vue'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
+ 'antd': path.join(__dirname, 'components'),
},
},
devServer: {