build docs

This commit is contained in:
cookfront
2017-03-22 17:35:58 +08:00
parent 5c41e13357
commit 1828753011
6 changed files with 51 additions and 55 deletions
+38 -4
View File
@@ -4,11 +4,17 @@
:class="blockClass"> :class="blockClass">
<slot name="examples"></slot> <slot name="examples"></slot>
<div class="highlight-wrapper"> <div class="highlight-wrapper">
<!-- <div class="highlight-toggle"> <div class="highlight-toggle">
<span v-text="description"></span> <span v-text="description"></span>
</div> --> <i class="zan-icon zan-icon-arrow" @click="showCode = !showCode" :class="{
<slot name="highlight"> 'zan-icon-arrow-close': !showCode
</slot> }">
</i>
</div>
<div class="highlight-code" v-show="showCode">
<slot name="highlight">
</slot>
</div>
</div> </div>
</div> </div>
</template> </template>
@@ -19,6 +25,12 @@ export default {
description: String description: String
}, },
data() {
return {
showCode: true
};
},
computed: { computed: {
blockClass() { blockClass() {
return `demo-${this.$route.path.split('/').pop()}`; return `demo-${this.$route.path.split('/').pop()}`;
@@ -39,6 +51,7 @@ export default {
.demo-block { .demo-block {
transition: .2s; transition: .2s;
overflow: hidden; overflow: hidden;
margin-bottom: 20px;
code { code {
font-family: Menlo, Monaco, Consolas, Courier, monospace; font-family: Menlo, Monaco, Consolas, Courier, monospace;
@@ -84,6 +97,27 @@ export default {
padding: 20px; padding: 20px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
color: #666; color: #666;
position: relative;
.zan-icon {
position: absolute;
top: 20px;
right: 20px;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
font-size: 12px;
color: #888;
transform: rotate(-90deg);
border: 2px solid #888;
border-radius: 50%;
cursor: pointer;
&.zan-icon-arrow-close {
transform: rotate(90deg);
}
}
} }
} }
</style> </style>
+1 -12
View File
File diff suppressed because one or more lines are too long
+1 -7
View File
File diff suppressed because one or more lines are too long
+1 -6
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -1,4 +1,4 @@
<template><section class="demo-button"><h1 class="demo-title">button</h1><example-block title="按钮功能"> <template><section class="demo-button"><h1 class="demo-title">button</h1><example-block title="按钮功能,只接受primary, default, danger三种类型,默认default。">
<zan-row> <zan-row>
<zan-col span="24"> <zan-col span="24">
<zan-button block="">default</zan-button> <zan-button block="">default</zan-button>
@@ -18,7 +18,7 @@
</zan-col> </zan-col>
</zan-row> </zan-row>
</example-block><example-block title="按钮尺寸"> </example-block><example-block title="按钮尺寸,只接受`large`, `normal`, `small`, `mini`四种尺寸,默认`normal`。">
<zan-row> <zan-row>
<zan-col span="24"> <zan-col span="24">
<zan-button size="large">large</zan-button> <zan-button size="large">large</zan-button>
@@ -36,7 +36,7 @@
</zan-col> </zan-col>
</zan-row> </zan-row>
</example-block><example-block title="自定义按钮标签"> </example-block><example-block title="自定义按钮标签,按钮默认是`button`标签,可以使用`tag`属性修改为一个`a`标签。">
<zan-row> <zan-row>
<zan-col span="24"> <zan-col span="24">
<zan-button tag="a" type="primary" href="https://www.youzan.com" target="_blank">a标签按钮</zan-button> <zan-button tag="a" type="primary" href="https://www.youzan.com" target="_blank">a标签按钮</zan-button>
+7 -23
View File
@@ -17,11 +17,13 @@
## Button 按钮 ## Button 按钮
### 按钮功能 ### 使用指南
只接受`primary`, `default`, `danger`三种类型,默认`default` 一些使用指南
:::demo 按钮功能 ### 代码示例
:::demo 按钮功能,只接受primary, default, danger三种类型,默认default。
```html ```html
<zan-row> <zan-row>
<zan-col span="24"> <zan-col span="24">
@@ -37,8 +39,6 @@
``` ```
::: :::
### 禁用状态
:::demo 禁用状态 :::demo 禁用状态
```html ```html
<zan-row> <zan-row>
@@ -49,11 +49,7 @@
``` ```
::: :::
### 按钮尺寸 :::demo 按钮尺寸,只接受`large`, `normal`, `small`, `mini`四种尺寸,默认`normal`
只接受`large`, `normal`, `small`, `mini`四种尺寸,默认`normal`
:::demo 按钮尺寸
```html ```html
<zan-row> <zan-row>
<zan-col span="24"> <zan-col span="24">
@@ -74,11 +70,7 @@
``` ```
::: :::
### 自定义按钮标签 :::demo 自定义按钮标签,按钮默认是`button`标签,可以使用`tag`属性修改为一个`a`标签。
按钮默认是`button`标签,可以使用`tag`属性修改为一个`a`标签。
:::demo 自定义按钮标签
```html ```html
<zan-row> <zan-row>
<zan-col span="24"> <zan-col span="24">
@@ -88,10 +80,6 @@
``` ```
::: :::
### loading按钮
表示`loading`状态
:::demo loading按钮 :::demo loading按钮
```html ```html
<zan-row> <zan-row>
@@ -105,10 +93,6 @@
``` ```
::: :::
### button group
一组按钮。
:::demo button group :::demo button group
```html ```html
<div class="button-group"> <div class="button-group">