stellar-ui-v2 1.40.1 → 1.40.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/components/ste-animate/animate.scss +247 -247
- package/components/ste-guide-qa/README.md +115 -115
- package/components/ste-index-list/README.md +6 -6
- package/components/ste-input/ste-input.vue +2 -2
- package/components/ste-message-box/ste-message-box.js +72 -72
- package/components/ste-navbar/README.md +125 -125
- package/components/ste-progress/README.md +18 -17
- package/components/ste-progress/ste-progress.vue +206 -200
- package/components/ste-qrcode/README.md +17 -17
- package/components/ste-qrcode/uqrcode.js +33 -33
- package/components/ste-rate/README.md +13 -13
- package/components/ste-select/datetime.vue +106 -106
- package/components/ste-stepper/README.md +14 -14
- package/components/ste-stepper/ste-stepper.vue +494 -494
- package/components/ste-swiper/README.md +29 -29
- package/components/ste-table/ste-table.vue +634 -634
- package/components/ste-table-column/checkbox-icon.vue +65 -65
- package/components/ste-table-column/common.scss +65 -65
- package/components/ste-table-column/radio-icon.vue +110 -110
- package/components/ste-table-column/sub-table.vue +116 -116
- package/components/ste-table-column/var.scss +1 -1
- package/components/ste-tabs/README.md +63 -63
- package/components/ste-tabs/props.js +212 -212
- package/components/ste-toast/ste-toast.js +69 -69
- package/components/ste-video/ste-video.vue +632 -632
- package/package.json +18 -18
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
# GuideQA 引导服务区
|
|
2
|
-
|
|
3
|
-
问答组件,用于展示常见问题和答案
|
|
4
|
-
|
|
5
|
-
---$
|
|
6
|
-
|
|
7
|
-
### 代码演示
|
|
8
|
-
|
|
9
|
-
#### 简单模式
|
|
10
|
-
|
|
11
|
-
通过`mode="1"`设置为简单模式,默认显示模式
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<template>
|
|
15
|
-
<ste-guide-qa :data="data" @click-all="handleClickAll"></ste-guide-qa>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
1
|
+
# GuideQA 引导服务区
|
|
2
|
+
|
|
3
|
+
问答组件,用于展示常见问题和答案
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
### 代码演示
|
|
8
|
+
|
|
9
|
+
#### 简单模式
|
|
10
|
+
|
|
11
|
+
通过`mode="1"`设置为简单模式,默认显示模式
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<template>
|
|
15
|
+
<ste-guide-qa :data="data" @click-all="handleClickAll"></ste-guide-qa>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
18
|
<script>
|
|
19
19
|
export default {
|
|
20
20
|
data() {
|
|
21
21
|
return {
|
|
22
|
-
data: [
|
|
23
|
-
{
|
|
24
|
-
question: '如何快速上手这个组件?',
|
|
25
|
-
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
question: '支持哪些浏览器?',
|
|
29
|
-
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
question: '如何自定义样式?',
|
|
33
|
-
answer: '可以通过 CSS 变量或者传入自定义的 class 来覆盖默认样式。',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
question: '遇到问题如何反馈?',
|
|
37
|
-
answer: '可以通过 GitHub Issues 或者官方交流群进行反馈。',
|
|
38
|
-
},
|
|
22
|
+
data: [
|
|
23
|
+
{
|
|
24
|
+
question: '如何快速上手这个组件?',
|
|
25
|
+
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
question: '支持哪些浏览器?',
|
|
29
|
+
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
question: '如何自定义样式?',
|
|
33
|
+
answer: '可以通过 CSS 变量或者传入自定义的 class 来覆盖默认样式。',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
question: '遇到问题如何反馈?',
|
|
37
|
+
answer: '可以通过 GitHub Issues 或者官方交流群进行反馈。',
|
|
38
|
+
},
|
|
39
39
|
]
|
|
40
40
|
}
|
|
41
41
|
},
|
|
@@ -44,86 +44,86 @@ export default {
|
|
|
44
44
|
console.log('点击查看全部');
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
#### 完整模式
|
|
52
|
-
|
|
53
|
-
通过`mode="2"`设置为完整模式,支持点击问题和答案
|
|
54
|
-
|
|
55
|
-
```html
|
|
56
|
-
<template>
|
|
57
|
-
<ste-guide-qa :data="data" mode="2" @click-item="handleClickItem"></ste-guide-qa>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<script>
|
|
61
|
-
export default {
|
|
62
|
-
data() {
|
|
63
|
-
return {
|
|
64
|
-
data: [
|
|
65
|
-
{
|
|
66
|
-
question: '如何快速上手这个组件?',
|
|
67
|
-
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
question: '支持哪些浏览器?',
|
|
71
|
-
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
question: '如何自定义样式?',
|
|
75
|
-
answer: '可以通过 CSS 变量或者传入自定义的 class 来覆盖默认样式。',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
question: '遇到问题如何反馈?',
|
|
79
|
-
answer: '可以通过 GitHub Issues 或者官方交流群进行反馈。',
|
|
80
|
-
},
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
methods: {
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### 完整模式
|
|
52
|
+
|
|
53
|
+
通过`mode="2"`设置为完整模式,支持点击问题和答案
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<template>
|
|
57
|
+
<ste-guide-qa :data="data" mode="2" @click-item="handleClickItem"></ste-guide-qa>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
export default {
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
data: [
|
|
65
|
+
{
|
|
66
|
+
question: '如何快速上手这个组件?',
|
|
67
|
+
answer: '请查看我们的快速入门指南,按照步骤操作即可。',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
question: '支持哪些浏览器?',
|
|
71
|
+
answer: '支持 Chrome 80+、Firefox 78+、Safari 14+、Edge 88+ 等现代浏览器。',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
question: '如何自定义样式?',
|
|
75
|
+
answer: '可以通过 CSS 变量或者传入自定义的 class 来覆盖默认样式。',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
question: '遇到问题如何反馈?',
|
|
79
|
+
answer: '可以通过 GitHub Issues 或者官方交流群进行反馈。',
|
|
80
|
+
},
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
85
|
const handleClickItem(type, item) {
|
|
86
86
|
console.log(`点击了${type === 'q' ? '问题' : '答案'}:`, item);
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
</script>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
#### 自定义标题
|
|
94
|
-
|
|
95
|
-
通过`title`设置标题文本,`actionTitle`设置操作按钮文本
|
|
96
|
-
|
|
97
|
-
```html
|
|
98
|
-
<template>
|
|
99
|
-
<ste-guide-qa :data="data" title="帮助中心" actionTitle="查看更多" @click-all="handleClickAll"></ste-guide-qa>
|
|
100
|
-
</template>
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
#### 是否显示数量
|
|
104
|
-
|
|
105
|
-
通过`showNum`控制是否显示数量
|
|
106
|
-
|
|
107
|
-
```html
|
|
108
|
-
<template>
|
|
109
|
-
<ste-guide-qa :data="data" :showNum="false"></ste-guide-qa>
|
|
110
|
-
</template>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
---$
|
|
114
|
-
|
|
115
|
-
### API
|
|
116
|
-
|
|
117
|
-
<!-- props -->
|
|
118
|
-
|
|
119
|
-
#### Slots
|
|
120
|
-
|
|
121
|
-
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
122
|
-
| ---------- | -------- | -------- | -------- |
|
|
123
|
-
| `prefix-q` | 问题前缀 | - | - |
|
|
124
|
-
| `prefix-a` | 答案前缀 | - | - |
|
|
125
|
-
|
|
126
|
-
---$
|
|
127
|
-
{{fuyuwei}}
|
|
128
|
-
|
|
129
|
-
{{qinpengfei}}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### 自定义标题
|
|
94
|
+
|
|
95
|
+
通过`title`设置标题文本,`actionTitle`设置操作按钮文本
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<template>
|
|
99
|
+
<ste-guide-qa :data="data" title="帮助中心" actionTitle="查看更多" @click-all="handleClickAll"></ste-guide-qa>
|
|
100
|
+
</template>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### 是否显示数量
|
|
104
|
+
|
|
105
|
+
通过`showNum`控制是否显示数量
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<template>
|
|
109
|
+
<ste-guide-qa :data="data" :showNum="false"></ste-guide-qa>
|
|
110
|
+
</template>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---$
|
|
114
|
+
|
|
115
|
+
### API
|
|
116
|
+
|
|
117
|
+
<!-- props -->
|
|
118
|
+
|
|
119
|
+
#### Slots
|
|
120
|
+
|
|
121
|
+
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
122
|
+
| ---------- | -------- | -------- | -------- |
|
|
123
|
+
| `prefix-q` | 问题前缀 | - | - |
|
|
124
|
+
| `prefix-a` | 答案前缀 | - | - |
|
|
125
|
+
|
|
126
|
+
---$
|
|
127
|
+
{{fuyuwei}}
|
|
128
|
+
|
|
129
|
+
{{qinpengfei}}
|
|
@@ -111,12 +111,12 @@ methods: {
|
|
|
111
111
|
|
|
112
112
|
#### IndexList Props
|
|
113
113
|
|
|
114
|
-
| 属性名 | 说明 |类型 |默认值 |可选值 | 支持版本 |
|
|
115
|
-
| --- |--- | --- | --- | --- | --- |
|
|
116
|
-
| `active` | 当前激活的索引下标,支持sync双向绑定,默认值0 | `Number` | `0` | - | - |
|
|
117
|
-
| `height` | 高度,默认值100% | `String`/`Number` | `"100%"` | - | - |
|
|
118
|
-
| `sticky` | `title`是否粘性布局,自定义`title`插槽时不生效 | `Boolean` | `true` | - | - |
|
|
119
|
-
| `inactiveColor` | 右边锚点状态非激活时的颜色 | `String` | `#666666` | - | - |
|
|
114
|
+
| 属性名 | 说明 |类型 |默认值 |可选值 | 支持版本 |
|
|
115
|
+
| --- |--- | --- | --- | --- | --- |
|
|
116
|
+
| `active` | 当前激活的索引下标,支持sync双向绑定,默认值0 | `Number` | `0` | - | - |
|
|
117
|
+
| `height` | 高度,默认值100% | `String`/`Number` | `"100%"` | - | - |
|
|
118
|
+
| `sticky` | `title`是否粘性布局,自定义`title`插槽时不生效 | `Boolean` | `true` | - | - |
|
|
119
|
+
| `inactiveColor` | 右边锚点状态非激活时的颜色 | `String` | `#666666` | - | - |
|
|
120
120
|
| `activeColor` | 右边锚点状态激活时的颜色 | `String` | `#0090FF` | - | - |
|
|
121
121
|
|
|
122
122
|
#### IndexList Events
|
|
@@ -287,10 +287,10 @@ export default {
|
|
|
287
287
|
},
|
|
288
288
|
methods: {
|
|
289
289
|
onInput(e) {
|
|
290
|
-
let value = e?.detail?.value || '';
|
|
290
|
+
let value = e.target?.value || e.detail?.value || '';
|
|
291
291
|
if (!this.disabled && !this.readonly) {
|
|
292
292
|
if (!this.allowSpace) {
|
|
293
|
-
|
|
293
|
+
value = value.replace(/\s*/g, '');
|
|
294
294
|
}
|
|
295
295
|
this.$nextTick(() => {
|
|
296
296
|
if (this.maxlength > 0) {
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import Vue from 'vue';
|
|
2
|
-
import Vuex from 'vuex';
|
|
3
|
-
|
|
4
|
-
Vue.use(Vuex);
|
|
5
|
-
const DEFAULT_KEY = '$steMsgBoxKey';
|
|
6
|
-
const DEFAULT_CONFIG = {
|
|
7
|
-
title: '',
|
|
8
|
-
content: '',
|
|
9
|
-
showCancel: true,
|
|
10
|
-
icon: '',
|
|
11
|
-
cancelText: '取消',
|
|
12
|
-
cancelColor: '#333333',
|
|
13
|
-
confirmText: '确认',
|
|
14
|
-
confirmColor: '',
|
|
15
|
-
editable: false,
|
|
16
|
-
placeholderText: '',
|
|
17
|
-
success: null,
|
|
18
|
-
fail: null,
|
|
19
|
-
complete: null,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const store = new Vuex.Store({
|
|
23
|
-
state: {},
|
|
24
|
-
mutations: {
|
|
25
|
-
initializeState(state, key) {
|
|
26
|
-
if (!state[key]) {
|
|
27
|
-
Vue.set(state, key, {
|
|
28
|
-
selector: key,
|
|
29
|
-
openBegin: false,
|
|
30
|
-
...DEFAULT_CONFIG,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
setState(state, { key, params }) {
|
|
35
|
-
Object.assign(state[key], params);
|
|
36
|
-
},
|
|
37
|
-
resetState(state, key) {
|
|
38
|
-
Object.assign(state[key], {
|
|
39
|
-
openBegin: false,
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
function useSteMsgBox(key) {
|
|
46
|
-
key = key ?? DEFAULT_KEY;
|
|
47
|
-
store.commit('initializeState', key);
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
showMsgBox(params) {
|
|
51
|
-
store.commit('setState', {
|
|
52
|
-
key,
|
|
53
|
-
params: {
|
|
54
|
-
...DEFAULT_CONFIG,
|
|
55
|
-
...params,
|
|
56
|
-
confirm: params.confirm ?? function () {},
|
|
57
|
-
cancel: params.cancel ?? function () {},
|
|
58
|
-
complete: params.complete ?? function () {},
|
|
59
|
-
openBegin: true,
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
hideMsgBox() {
|
|
64
|
-
store.commit('resetState', key);
|
|
65
|
-
},
|
|
66
|
-
$state: store.state[key],
|
|
67
|
-
$store: store,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export default useSteMsgBox;
|
|
72
|
-
export { DEFAULT_KEY };
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import Vuex from 'vuex';
|
|
3
|
+
|
|
4
|
+
Vue.use(Vuex);
|
|
5
|
+
const DEFAULT_KEY = '$steMsgBoxKey';
|
|
6
|
+
const DEFAULT_CONFIG = {
|
|
7
|
+
title: '',
|
|
8
|
+
content: '',
|
|
9
|
+
showCancel: true,
|
|
10
|
+
icon: '',
|
|
11
|
+
cancelText: '取消',
|
|
12
|
+
cancelColor: '#333333',
|
|
13
|
+
confirmText: '确认',
|
|
14
|
+
confirmColor: '',
|
|
15
|
+
editable: false,
|
|
16
|
+
placeholderText: '',
|
|
17
|
+
success: null,
|
|
18
|
+
fail: null,
|
|
19
|
+
complete: null,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const store = new Vuex.Store({
|
|
23
|
+
state: {},
|
|
24
|
+
mutations: {
|
|
25
|
+
initializeState(state, key) {
|
|
26
|
+
if (!state[key]) {
|
|
27
|
+
Vue.set(state, key, {
|
|
28
|
+
selector: key,
|
|
29
|
+
openBegin: false,
|
|
30
|
+
...DEFAULT_CONFIG,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
setState(state, { key, params }) {
|
|
35
|
+
Object.assign(state[key], params);
|
|
36
|
+
},
|
|
37
|
+
resetState(state, key) {
|
|
38
|
+
Object.assign(state[key], {
|
|
39
|
+
openBegin: false,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
function useSteMsgBox(key) {
|
|
46
|
+
key = key ?? DEFAULT_KEY;
|
|
47
|
+
store.commit('initializeState', key);
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
showMsgBox(params) {
|
|
51
|
+
store.commit('setState', {
|
|
52
|
+
key,
|
|
53
|
+
params: {
|
|
54
|
+
...DEFAULT_CONFIG,
|
|
55
|
+
...params,
|
|
56
|
+
confirm: params.confirm ?? function () {},
|
|
57
|
+
cancel: params.cancel ?? function () {},
|
|
58
|
+
complete: params.complete ?? function () {},
|
|
59
|
+
openBegin: true,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
hideMsgBox() {
|
|
64
|
+
store.commit('resetState', key);
|
|
65
|
+
},
|
|
66
|
+
$state: store.state[key],
|
|
67
|
+
$store: store,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default useSteMsgBox;
|
|
72
|
+
export { DEFAULT_KEY };
|
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
# Navbar 导航栏
|
|
2
|
-
|
|
3
|
-
提供导航功能,常用于页面顶部。
|
|
4
|
-
|
|
5
|
-
---$
|
|
6
|
-
|
|
7
|
-
## 代码演示
|
|
8
|
-
|
|
9
|
-
### 基本使用
|
|
10
|
-
|
|
11
|
-
通过 `title`设置导航栏标题,插槽`default`设置导航栏内容
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<template>
|
|
15
|
-
<ste-navbar title="标题">插槽</ste-navbar>
|
|
16
|
-
</template>
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### 返回按钮配置
|
|
20
|
-
|
|
21
|
-
- 通过 `autoBack` 属性来设置是否显示返回按钮,默认`true`
|
|
22
|
-
- 通过 `backColor` 属性来设置返回按钮颜色,默认`#000`
|
|
23
|
-
- 通过 `backCode` 属性来设置返回按钮icon的code,默认``
|
|
24
|
-
- 通过 `backBackgroundColor` 属性来设置返回按钮的背景颜色,默认`transparent`
|
|
25
|
-
- 通过 `backBorderColor` 属性来设置返回返回按钮的边框颜色,默认`transparent`
|
|
26
|
-
- 通过 `backOpacity` 属性来设置返回按钮透明度,默认`1`
|
|
27
|
-
|
|
28
|
-
```html
|
|
29
|
-
<template>
|
|
30
|
-
<ste-navbar title="隐藏返回按钮" :autoBack="false"></ste-navbar>
|
|
31
|
-
<ste-navbar title="返回按钮各配置" backColor="red" backCode="" backBackgroundColor="green" backBorderColor="blue" :backOpacity="0.4"></ste-navbar>
|
|
32
|
-
</template>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### 标题配置
|
|
36
|
-
|
|
37
|
-
- 通过 `title` 属性来设置标题文本,默认`''`
|
|
38
|
-
- 通过 `titleColor` 属性来设置标题颜色,默认`#181818`
|
|
39
|
-
- 通过 `titleAlignment` 属性来设置标题对齐方式,`1` :居左,`2`:居中,默认`1`
|
|
40
|
-
|
|
41
|
-
```html
|
|
42
|
-
<template>
|
|
43
|
-
<ste-navbar title="标题各配置" titleColor="red" :titleAlignment="2" :zIndex="100"></ste-navbar>
|
|
44
|
-
</template>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 导航栏配置
|
|
48
|
-
|
|
49
|
-
- 通过 `fixed` 属性来设置是否固定到顶部,默认`false`
|
|
50
|
-
- 通过 `safeAreaInsetTop` 属性来设置是否开启顶部安全区适配,默认`true`
|
|
51
|
-
- 通过 `zIndex` 属性来设置导航栏 z-index,默认`10`
|
|
52
|
-
- 通过 `backgroundColor` 属性来设置导航栏背景色,默认`transparent`
|
|
53
|
-
- 通过 `colorType` 属性来设置支付宝小程序专属属性,导航栏背景色,`1` :黑色,`2`:白色,默认`1`
|
|
54
|
-
|
|
55
|
-
```html
|
|
56
|
-
<template>
|
|
57
|
-
<ste-navbar title="导航栏配置" backgroundColor="red"></ste-navbar>
|
|
58
|
-
</template>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### 回调事件
|
|
62
|
-
|
|
63
|
-
通过 `backClick` 获取返回按钮点击事件
|
|
64
|
-
|
|
65
|
-
```html
|
|
66
|
-
<template>
|
|
67
|
-
<ste-navbar title="事件" @backClick="backClick"></ste-navbar>
|
|
68
|
-
</template>
|
|
69
|
-
|
|
70
|
-
<script>
|
|
71
|
-
export default {
|
|
72
|
-
data() {
|
|
73
|
-
return {};
|
|
74
|
-
},
|
|
75
|
-
created() {},
|
|
76
|
-
methods: {
|
|
77
|
-
backClick() {
|
|
78
|
-
this.$showToast({
|
|
79
|
-
icon: 'none',
|
|
80
|
-
title: '导航栏点击事件',
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
</script>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
---$
|
|
89
|
-
|
|
90
|
-
### API
|
|
91
|
-
|
|
92
|
-
#### Props
|
|
93
|
-
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
94
|
-
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
95
|
-
| `autoBack` | 是否显示返回按钮 | `Boolean` | `true` | - | - |
|
|
96
|
-
| `backColor` | 返回按钮颜色 | `String` | `#000` | - | - |
|
|
97
|
-
| `backCode` | 返回按钮icon的code | `String` | `` | - | - |
|
|
98
|
-
| `backCode` | 返回按钮icon的code | `String` | `` | - | - |
|
|
99
|
-
| `backBackgroundColor` | 返回按钮的背景颜色 | `String` | `transparent` | - | - |
|
|
100
|
-
| `backBorderColor` | 返回按钮的边框颜色 | `String` | `transparent` | - | - |
|
|
101
|
-
| `backOpacity` | 返回按钮透明度 | `Number` | `1` | - | - |
|
|
102
|
-
| `stopNavigateBack` | 是否阻止点击返回按钮后,返回到上一页 | `Boolean` | `false` | - | - |
|
|
103
|
-
| `title` | 标题文本 | `String` | `` | - | - |
|
|
104
|
-
| `titleColor` | 标题颜色 | `String` | `#181818` | - | - |
|
|
105
|
-
| `titleAlignment` | 标题对齐方式 | `Number` | `1` | `1`:居左<br/>`2`:居中 | - |
|
|
106
|
-
| `fixed` | 是否固定到顶部 | `Boolean` | `false` | - | - |
|
|
107
|
-
| `safeAreaInsetTop` | 是否开启顶部安全区适配 | `Boolean` | `true` | - | - |
|
|
108
|
-
| `zIndex` | 导航栏 z-index | `Number` | `10` | - | - |
|
|
109
|
-
| `backgroundColor` | 导航栏背景色 | `String` | `transparent` | - | - |
|
|
110
|
-
| `colorType` | 标题对齐方式 | `Number/String` | `left` | `1`:黑色<br/>`2`:白色 | - |
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
#### Events
|
|
114
|
-
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
115
|
-
| ----- | ----- | ------- | -------- |
|
|
116
|
-
| `backClick` | 返回按钮点击 | - | - |
|
|
117
|
-
|
|
118
|
-
#### Slots
|
|
119
|
-
|
|
120
|
-
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
121
|
-
| --------- | ---------- | -------- | -------- |
|
|
122
|
-
| `default` | 导航栏内容 | - | - |
|
|
123
|
-
|
|
124
|
-
---$
|
|
125
|
-
{{fuyuwei}}
|
|
1
|
+
# Navbar 导航栏
|
|
2
|
+
|
|
3
|
+
提供导航功能,常用于页面顶部。
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
## 代码演示
|
|
8
|
+
|
|
9
|
+
### 基本使用
|
|
10
|
+
|
|
11
|
+
通过 `title`设置导航栏标题,插槽`default`设置导航栏内容
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<template>
|
|
15
|
+
<ste-navbar title="标题">插槽</ste-navbar>
|
|
16
|
+
</template>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 返回按钮配置
|
|
20
|
+
|
|
21
|
+
- 通过 `autoBack` 属性来设置是否显示返回按钮,默认`true`
|
|
22
|
+
- 通过 `backColor` 属性来设置返回按钮颜色,默认`#000`
|
|
23
|
+
- 通过 `backCode` 属性来设置返回按钮icon的code,默认``
|
|
24
|
+
- 通过 `backBackgroundColor` 属性来设置返回按钮的背景颜色,默认`transparent`
|
|
25
|
+
- 通过 `backBorderColor` 属性来设置返回返回按钮的边框颜色,默认`transparent`
|
|
26
|
+
- 通过 `backOpacity` 属性来设置返回按钮透明度,默认`1`
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<template>
|
|
30
|
+
<ste-navbar title="隐藏返回按钮" :autoBack="false"></ste-navbar>
|
|
31
|
+
<ste-navbar title="返回按钮各配置" backColor="red" backCode="" backBackgroundColor="green" backBorderColor="blue" :backOpacity="0.4"></ste-navbar>
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 标题配置
|
|
36
|
+
|
|
37
|
+
- 通过 `title` 属性来设置标题文本,默认`''`
|
|
38
|
+
- 通过 `titleColor` 属性来设置标题颜色,默认`#181818`
|
|
39
|
+
- 通过 `titleAlignment` 属性来设置标题对齐方式,`1` :居左,`2`:居中,默认`1`
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<template>
|
|
43
|
+
<ste-navbar title="标题各配置" titleColor="red" :titleAlignment="2" :zIndex="100"></ste-navbar>
|
|
44
|
+
</template>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 导航栏配置
|
|
48
|
+
|
|
49
|
+
- 通过 `fixed` 属性来设置是否固定到顶部,默认`false`
|
|
50
|
+
- 通过 `safeAreaInsetTop` 属性来设置是否开启顶部安全区适配,默认`true`
|
|
51
|
+
- 通过 `zIndex` 属性来设置导航栏 z-index,默认`10`
|
|
52
|
+
- 通过 `backgroundColor` 属性来设置导航栏背景色,默认`transparent`
|
|
53
|
+
- 通过 `colorType` 属性来设置支付宝小程序专属属性,导航栏背景色,`1` :黑色,`2`:白色,默认`1`
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<template>
|
|
57
|
+
<ste-navbar title="导航栏配置" backgroundColor="red"></ste-navbar>
|
|
58
|
+
</template>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 回调事件
|
|
62
|
+
|
|
63
|
+
通过 `backClick` 获取返回按钮点击事件
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<template>
|
|
67
|
+
<ste-navbar title="事件" @backClick="backClick"></ste-navbar>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script>
|
|
71
|
+
export default {
|
|
72
|
+
data() {
|
|
73
|
+
return {};
|
|
74
|
+
},
|
|
75
|
+
created() {},
|
|
76
|
+
methods: {
|
|
77
|
+
backClick() {
|
|
78
|
+
this.$showToast({
|
|
79
|
+
icon: 'none',
|
|
80
|
+
title: '导航栏点击事件',
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
</script>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---$
|
|
89
|
+
|
|
90
|
+
### API
|
|
91
|
+
|
|
92
|
+
#### Props
|
|
93
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
94
|
+
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
95
|
+
| `autoBack` | 是否显示返回按钮 | `Boolean` | `true` | - | - |
|
|
96
|
+
| `backColor` | 返回按钮颜色 | `String` | `#000` | - | - |
|
|
97
|
+
| `backCode` | 返回按钮icon的code | `String` | `` | - | - |
|
|
98
|
+
| `backCode` | 返回按钮icon的code | `String` | `` | - | - |
|
|
99
|
+
| `backBackgroundColor` | 返回按钮的背景颜色 | `String` | `transparent` | - | - |
|
|
100
|
+
| `backBorderColor` | 返回按钮的边框颜色 | `String` | `transparent` | - | - |
|
|
101
|
+
| `backOpacity` | 返回按钮透明度 | `Number` | `1` | - | - |
|
|
102
|
+
| `stopNavigateBack` | 是否阻止点击返回按钮后,返回到上一页 | `Boolean` | `false` | - | - |
|
|
103
|
+
| `title` | 标题文本 | `String` | `` | - | - |
|
|
104
|
+
| `titleColor` | 标题颜色 | `String` | `#181818` | - | - |
|
|
105
|
+
| `titleAlignment` | 标题对齐方式 | `Number` | `1` | `1`:居左<br/>`2`:居中 | - |
|
|
106
|
+
| `fixed` | 是否固定到顶部 | `Boolean` | `false` | - | - |
|
|
107
|
+
| `safeAreaInsetTop` | 是否开启顶部安全区适配 | `Boolean` | `true` | - | - |
|
|
108
|
+
| `zIndex` | 导航栏 z-index | `Number` | `10` | - | - |
|
|
109
|
+
| `backgroundColor` | 导航栏背景色 | `String` | `transparent` | - | - |
|
|
110
|
+
| `colorType` | 标题对齐方式 | `Number/String` | `left` | `1`:黑色<br/>`2`:白色 | - |
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
#### Events
|
|
114
|
+
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
115
|
+
| ----- | ----- | ------- | -------- |
|
|
116
|
+
| `backClick` | 返回按钮点击 | - | - |
|
|
117
|
+
|
|
118
|
+
#### Slots
|
|
119
|
+
|
|
120
|
+
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
121
|
+
| --------- | ---------- | -------- | -------- |
|
|
122
|
+
| `default` | 导航栏内容 | - | - |
|
|
123
|
+
|
|
124
|
+
---$
|
|
125
|
+
{{fuyuwei}}
|