Skip to content

Commit

Permalink
add Divider
Browse files Browse the repository at this point in the history
  • Loading branch information
icarusion committed Jul 9, 2018
1 parent 59b52bc commit 338ffe3
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/code/divider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
let code = {};

code.import = `
"usingComponents": {
"i-divider": "../../dist/divider/index"
}
`;
code.usage = `
<i-divider content="加载已经完成,没有其他数据"></i-divider>
<i-divider content="加载已经完成,没有其他数据" color="#2d8cf0" lineColor="#2d8cf0"></i-divider>
<i-divider content="加载已经完成,没有其他数据" lineColor="#2d8cf0"></i-divider>
<i-divider content="加载已经完成,没有其他数据" color="#ed3f14" lineColor="#ed3f14"></i-divider>
<i-divider content="加载已经完成,没有其他数据" color="#ff9900" lineColor="#ff9900"></i-divider>
<i-divider color="#2d8cf0" lineColor="#2d8cf0">加载已经完成,没有其他数据</i-divider>
<i-divider color="#ed3f14" lineColor="#ed3f14">加载已经完成,没有其他数据</i-divider>
`;

export default code;
4 changes: 4 additions & 0 deletions src/config/navigate.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ const list = {
title: 'CountDown 倒计时',
path: '/components/count-down'
},
{
title: 'Divider 分隔符',
path: '/components/divider'
},
]
},
{
Expand Down
7 changes: 7 additions & 0 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ const routers = [
},
component: (resolve) => require(['./views/components/index.vue'], resolve)
},
{
path: '/components/divider',
meta: {
title: '分隔符 Divider'
},
component: (resolve) => require(['./views/components/divider.vue'], resolve)
},
{
path: '*',
redirect: '/'
Expand Down
88 changes: 88 additions & 0 deletions src/views/components/divider.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<template>
<i-article>
<article>
<h1>Divider 分隔符</h1>
<Anchor title="概述" h2></Anchor>
<Anchor title="使用指南" h2></Anchor>
<p>在 .json 中引入组件</p>
<i-code bg lang="json">{{ code.import }}</i-code>
<Anchor title="示例" h2></Anchor>
<i-code bg lang="html">{{ code.usage }}</i-code>
<ad></ad>

<div class="api">
<Anchor title="API" h2></Anchor>
<Anchor title="Divider properties" h3></Anchor>
<table>
<thead>
<tr>
<th>属性</th>
<th>说明</th>
<th>类型</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td>i-class</td>
<td>自定义 class 类名</td>
<td>String</td>
<td>-</td>
</tr>
<tr>
<td>content</td>
<td>内容,不定义则使用 slot</td>
<td>String</td>
<td>-</td>
</tr>
<tr>
<td>height</td>
<td>高度</td>
<td>Number</td>
<td>48</td>
</tr>
<tr>
<td>color</td>
<td>文字颜色</td>
<td>String</td>
<td>#80848f</td>
</tr>
<tr>
<td>line-color</td>
<td>辅助线的颜色</td>
<td>String</td>
<td>#e9eaec</td>
</tr>
<tr>
<td>size</td>
<td>文字大小</td>
<td>String</td>
<td>12</td>
</tr>
</tbody>
</table>
</div>
</article>
</i-article>
</template>
<script>
import iArticle from '../../components/article.vue';
import iCode from 'iCode';
import Demo from '../../components/demo.vue';
import Code from '../../code/divider';
import Anchor from '../../components/anchor.vue';
export default {
components: {
iArticle,
iCode,
Demo,
Anchor
},
data () {
return {
code: Code
}
}
}
</script>

0 comments on commit 338ffe3

Please sign in to comment.