Skip to content

Commit 5e9079b

Browse files
authored
Merge pull request #4 from iview/dewyzee/dev
add new components
2 parents 6b38212 + e6cc4a2 commit 5e9079b

File tree

13 files changed

+224
-11
lines changed

13 files changed

+224
-11
lines changed

build/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
55
## 项目目录
66

7-
|—— assets // 项目静态资源
8-
|—— build
9-
| ├── template // 快速创建目录模板
10-
| ├── util // 构建公共方法
11-
| ├── build-dev.js // 构建dev模式
12-
| ├── build-prod.js // 构建产出模式
13-
|—— example // 示例目录
14-
|—— src
15-
| ├── components 组件目录
16-
| ├── index.js // 入口文件
7+
|-- assets // 项目静态资源
8+
|-- build
9+
| |-- template // 快速创建目录模板
10+
| |-- util // 构建公共方法
11+
| |-- build-dev.js // 构建dev模式
12+
| |-- build-prod.js // 构建产出模式
13+
|-- example // 示例目录
14+
|-- src
15+
| |-- components 组件目录
16+
| |-- index.js // 入口文件
1717
|
18-
|—— ...
18+
|-- ...
19+
1920

2021
## 组件开发说明
2122

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<div>
3+
<div class="i-class i-cell-group">
4+
<slot></slot>
5+
</div>
6+
</div>
7+
</template>

src/components/cell-group/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import cellGroup from 'cell-group.vue'
2+
3+
export default cellGroup
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import '../../common/_base.less';
2+
@import '../../common/_mixins.less';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import './cell-group.less'

src/components/cell/cell.vue

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<template>
2+
<div>
3+
<div @click="handleTap" class="i-class i-cell">
4+
<div class="i-cell-icon">
5+
<slot name="icon"></slot>
6+
</div>
7+
<div class="i-cell-bd">
8+
<p v-if="title" class="i-cell-text">{{ title }}</p>
9+
<p v-if="label" class="i-cell-desc">{{ label }}</p>
10+
<slot></slot>
11+
</div>
12+
<div @click.capture="navigateTo" class="i-cell-ft">
13+
<div v-if="value">{{ value }}</div>
14+
<div v-else="">
15+
<slot name="footer"></slot>
16+
</div>
17+
</div>
18+
</div>
19+
</div>
20+
</template>
21+
22+
<script>
23+
export default {
24+
props: {
25+
// 左侧标题
26+
title: {
27+
type: String
28+
},
29+
// 标题下方的描述信息
30+
label: {
31+
type: String
32+
},
33+
// 右侧内容
34+
value: {
35+
type: String
36+
},
37+
// 只有点击 footer 区域才触发 tab 事件
38+
onlyTapFooter: {
39+
type: Boolean
40+
},
41+
// 是否展示右侧箭头并开启尝试以 url 跳转
42+
isLink: {
43+
type: null,
44+
value: ''
45+
},
46+
// 链接类型,可选值为 navigateTo,redirectTo,switchTab,reLaunch
47+
linkType: {
48+
type: String,
49+
value: 'navigateTo'
50+
},
51+
url: {
52+
type: String,
53+
value: ''
54+
}
55+
}
56+
}
57+
</script>

src/components/cell/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import cell from 'cell.vue'
2+
3+
export default cell
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
@import '../../common/_base.less';
2+
@import '../../common/_mixins.less';
3+
4+
.i-cell {
5+
position: relative;
6+
padding: 12px 15px;
7+
display: flex;
8+
background: #fff;
9+
align-items: center;
10+
line-height: 1.4;
11+
font-size: @size-font-base;
12+
overflow: hidden;
13+
14+
&::after{
15+
.hairline();
16+
border-bottom-width: 1px;
17+
left: 15px;
18+
right: 0;
19+
}
20+
&-last::after{
21+
display: none;
22+
}
23+
24+
&-icon{
25+
margin-right: 5px;
26+
&:empty{
27+
display: none
28+
}
29+
}
30+
31+
&-bd{
32+
flex: 1;
33+
}
34+
35+
&-text{
36+
line-height: 24px;
37+
font-size: @size-font-base;
38+
}
39+
40+
&-desc{
41+
line-height: 1.2;
42+
font-size: @size-font-small;
43+
color: @subsidiary-color;
44+
}
45+
46+
&-ft{
47+
position: relative;
48+
text-align: right;
49+
color: @text-color;
50+
}
51+
52+
&-access &-ft{
53+
padding-right: 13px;
54+
&::after{
55+
content: " ";
56+
display: inline-block;
57+
width: 6px;
58+
height: 6px;
59+
position: absolute;
60+
top: 50%;
61+
right: 2px;
62+
border-width: 2px 2px 0 0;
63+
border-color: @border-color-base;
64+
border-style: solid;
65+
transform: translateY(-50%) matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
66+
}
67+
}
68+
}

src/components/cell/style/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import './cell.less'

src/components/panel/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import panel from 'panel.vue'
2+
3+
export default panel

0 commit comments

Comments
 (0)