diff --git a/build/webpack.config.js b/build/webpack.config.js
index 0c8682c2e..dc769f7d2 100644
--- a/build/webpack.config.js
+++ b/build/webpack.config.js
@@ -118,6 +118,27 @@ if (process.env.NODE_ENV === 'production') {
slugify: slugify,
permalink: true,
permalinkBefore: true
+ }],
+ [require('markdown-it-container'), 'demo', {
+ validate: function(params) {
+ return params.trim().match(/^demo\s*(.*)$/);
+ },
+
+ render: function(tokens, idx) {
+ var m = tokens[idx].info.trim().match(/^demo\s*(.*)$/);
+ if (tokens[idx].nesting === 1) {
+ var description = (m && m.length > 1) ? m[1] : '';
+ var content = tokens[idx + 1].content;
+ var html = convert(striptags.strip(content, ['script', 'style']));
+ var script = striptags.fetch(content, 'script');
+ var style = striptags.fetch(content, 'style');
+
+ return `
+ ${html}
+ `;
+ }
+ return '
\n';
+ }
}]
],
preprocess: function(MarkdownIt, source) {
diff --git a/docs/ExamplesDocsApp.vue b/docs/ExamplesDocsApp.vue
index 7c38f8cc9..454ec1d6c 100644
--- a/docs/ExamplesDocsApp.vue
+++ b/docs/ExamplesDocsApp.vue
@@ -4,7 +4,6 @@
-
@@ -68,26 +67,11 @@ export default {
}
.page-content {
- width: 52%;
box-sizing: border-box;
- float: left;
- padding: 0 15px;
overflow: auto;
height: inherit;
- }
-
- .mobile-wrapper {
- float: left;
- width: 30%;
- height: 300px;
- position: relative;
- }
-
- .mobile {
- margin: 20px 20px 0;
- height: 100%;
- box-sizing: border-box;
- width: 365px;
+ margin-left: 320px;
+ padding: 0 20px;
}
.demo-page {
diff --git a/docs/components/demo-block.vue b/docs/components/demo-block.vue
new file mode 100644
index 000000000..b32daf996
--- /dev/null
+++ b/docs/components/demo-block.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/components/mobile.vue b/docs/components/mobile.vue
deleted file mode 100644
index 8685d2452..000000000
--- a/docs/components/mobile.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
diff --git a/docs/components/side-nav.vue b/docs/components/side-nav.vue
index 17e0c9f01..17a1c0f6d 100644
--- a/docs/components/side-nav.vue
+++ b/docs/components/side-nav.vue
@@ -62,7 +62,7 @@
+
## Button组件
### 按钮功能
只接受primary, default, danger三种类型,默认default。
+:::demo
```html
-
+
+
+ default
+
+
+ primary
+
+
+ danger
+
+
```
+:::
### 禁用状态
+:::demo
```html
-
+
+
+ diabled
+
+
```
+:::
### 按钮尺寸
只接受large, normal, small, mini四种尺寸,默认normal。
+:::demo
```html
-
-
-
+
+
+
+
+ normal
+
+
+ small
+
+
+ mini
+
+
```
+:::
### 自定义按钮标签
按钮默认是button标签,可以使用tag属性修改为一个a标签。
+:::demo
```html
-
+
+
```
+:::
### loading按钮
表示loading状态
+:::demo
```html
-
+
+
+ loading
+
+
+
+
+
```
+:::
### button group
一组按钮。
+:::demo
```html
-