Skip to content

Commit 2194a0c

Browse files
authored
Merge pull request #29 from sunkint/dev
v0.4.0
2 parents e016e0b + fc24882 commit 2194a0c

File tree

28 files changed

+786
-26
lines changed

28 files changed

+786
-26
lines changed

.vitepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ module.exports = {
5454
'Swiper',
5555
'InfiniteScroll',
5656
'Preview',
57+
'Steps',
5758
].map(buildNavChildren),
5859
},
5960
{

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ make build
7777
- [x] Mention
7878
- [x] Preview
7979
- [x] DatePicker
80+
- [x] Steps
8081

8182
## 作者
8283

docs/components/alert/closable.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<sk-alert v-if="show" closable @close="show = false">
44
<b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a>
55
</sk-alert>
6+
<sk-alert v-if="show2" closable @close="show2 = false" size="small">
7+
<b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a>
8+
</sk-alert>
69
</div>
710
</template>
811

@@ -11,6 +14,7 @@ export default {
1114
data() {
1215
return {
1316
show: true,
17+
show2: true,
1418
};
1519
},
1620
};

docs/components/alert/index.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,36 @@
44

55
<div class="docs-preview-part">
66
<sk-alert><b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a></sk-alert>
7+
<sk-alert size="small"><b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a></sk-alert>
78
</div>
89

910
```vue
1011
<template>
1112
<div class="docs-preview-part">
1213
<sk-alert><b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a></sk-alert>
14+
<sk-alert size="small">
15+
<b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a>
16+
</sk-alert>
17+
</div>
18+
</template>
19+
```
20+
21+
### 带图标
22+
23+
<div class="docs-preview-part">
24+
<sk-alert icon="ok"><b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a></sk-alert>
25+
<sk-alert icon="ok" size="small"><b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a></sk-alert>
26+
</div>
27+
28+
```vue
29+
<template>
30+
<div class="docs-preview-part">
31+
<sk-alert icon="ok">
32+
<b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a>
33+
</sk-alert>
34+
<sk-alert icon="ok" size="small">
35+
<b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a>
36+
</sk-alert>
1337
</div>
1438
</template>
1539
```
@@ -24,6 +48,9 @@
2448
<sk-alert v-if="show" closable @close="show = false">
2549
<b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a>
2650
</sk-alert>
51+
<sk-alert v-if="show2" closable @close="show2 = false" size="small">
52+
<b>好棒!</b> 你成功阅读了这条重要的信息。<a href="#">查看更多…</a>
53+
</sk-alert>
2754
</div>
2855
</template>
2956
@@ -126,10 +153,12 @@ export default {
126153

127154
### API
128155

129-
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
130-
| -------- | ---------- | ------ | ------------------------------------------------------------------------------- | ------- |
131-
| type | 样式类型 | string | `primary``secondary``success``info``warning``danger``light``dark` | `info` |
132-
| closable | 是否可关闭 | string | | `false` |
156+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
157+
| -------- | ---------- | ------ | ------------------------------------------------------------------------------- | -------- |
158+
| type | 样式类型 | string | `primary``secondary``success``info``warning``danger``light``dark` | `info` |
159+
| size | 尺寸 | string | `normal``small` | `normal` |
160+
| icon | 前置图标 | string | 详见 [Icon](../icon/index#内置图标) 组件的 type | - |
161+
| closable | 是否可关闭 | string | | `false` |
133162

134163
### 事件
135164

docs/components/avatar/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
| size | 头像大小 | number、string | `small``default``large`、数字(最小 20) | `default` |
116116
| shape | 头像形状 | string | `circle``square` | `circle` |
117117
| bordered | 是否有边框 | bool | | `false` |
118+
| inline | 是否行内块 | bool | | `false` |
118119
| src | 图片路径 | string | | - |
119120
| icon | 图标类型,和 `src` 需要二选一赋值 | string | | - |
120121
| href | 头像点击时打开的链接 | string | | - |

docs/components/datepicker/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ format 参数请参考 [**date-fns** format](https://date-fns.org/v2.17.0/docs/f
140140
| clearable | 是否支持清除 | bool | | `false` |
141141
| format | 自定义日期显示格式,详见 [**date-fns** format](https://date-fns.org/v2.17.0/docs/format) | string | | `yyyy-MM-dd` |
142142
| startView | 开始选择的面板类型 | string | `day``month``year` | `day` |
143+
| initViewDate | 没有选定值时,展开的默认日期 | Date | | `new Date()` |
143144
| minDate | 最小选择的日期 | Date | | - |
144145
| maxDate | 最大选择的日期 | Date | | - |
145146
| weekStartsOn | 一周的开始日,0 代表周日,6 代表周六 | number | 0 - 6 | 1 |

docs/components/steps/basic.vue

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<template>
2+
<div class="docs-preview-part">
3+
<sk-steps :current="current">
4+
<sk-step title="第一步" description="填写注册信息" />
5+
<sk-step title="第二步" description="完善用户资料" />
6+
<sk-step title="第三步" description="注册成功" />
7+
</sk-steps>
8+
<sk-button @click="prev">上一步</sk-button>
9+
<sk-button @click="next">下一步</sk-button>
10+
</div>
11+
</template>
12+
13+
<script>
14+
export default {
15+
data() {
16+
return {
17+
current: 0,
18+
};
19+
},
20+
methods: {
21+
prev() {
22+
if (this.current > 0) {
23+
this.current--;
24+
}
25+
},
26+
next() {
27+
if (this.current < 2) {
28+
this.current++;
29+
}
30+
},
31+
},
32+
};
33+
</script>
34+
35+
<style scoped>
36+
button {
37+
margin-top: 12px;
38+
}
39+
</style>

docs/components/steps/error.vue

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<template>
2+
<div class="docs-preview-part">
3+
<sk-steps :current="current" status="error">
4+
<sk-step title="第一步" description="填写注册信息" />
5+
<sk-step title="第二步" description="完善用户资料" />
6+
<sk-step title="第三步" description="注册成功" />
7+
</sk-steps>
8+
<sk-button @click="prev">上一步</sk-button>
9+
<sk-button @click="next">下一步</sk-button>
10+
</div>
11+
</template>
12+
13+
<script>
14+
export default {
15+
data() {
16+
return {
17+
current: 0,
18+
};
19+
},
20+
methods: {
21+
prev() {
22+
if (this.current > 0) {
23+
this.current--;
24+
}
25+
},
26+
next() {
27+
if (this.current < 2) {
28+
this.current++;
29+
}
30+
},
31+
},
32+
};
33+
</script>
34+
35+
<style scoped>
36+
button {
37+
margin-top: 12px;
38+
}
39+
</style>

docs/components/steps/icon.vue

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<template>
2+
<div class="docs-preview-part">
3+
<sk-steps :current="current">
4+
<sk-step title="第一步" icon="buy" description="填写注册信息" />
5+
<sk-step title="第二步" icon="car" description="完善用户资料" />
6+
<sk-step title="第三步" icon="drift-bottle" description="注册成功" />
7+
</sk-steps>
8+
<sk-button @click="prev">上一步</sk-button>
9+
<sk-button @click="next">下一步</sk-button>
10+
</div>
11+
</template>
12+
13+
<script>
14+
export default {
15+
data() {
16+
return {
17+
current: 0,
18+
};
19+
},
20+
methods: {
21+
prev() {
22+
if (this.current > 0) {
23+
this.current--;
24+
}
25+
},
26+
next() {
27+
if (this.current < 2) {
28+
this.current++;
29+
}
30+
},
31+
},
32+
};
33+
</script>
34+
35+
<style scoped>
36+
button {
37+
margin-top: 12px;
38+
}
39+
</style>

0 commit comments

Comments
 (0)