@gmcb/uv-ui 0.2.26 → 0.3.0

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +21 -21
  3. package/README.md +95 -141
  4. package/components/uv-overlay/props.js +29 -24
  5. package/components/uv-overlay/uv-overlay.vue +87 -85
  6. package/docs/api/configs/color.md +52 -0
  7. package/docs/api/index.md +77 -0
  8. package/docs/api/mixins/mpShare.md +95 -0
  9. package/docs/api/request/apiManage.md +88 -0
  10. package/docs/api/request/http.md +451 -0
  11. package/docs/api/utils/colorSwitch.md +78 -0
  12. package/docs/api/utils/debounce.md +104 -0
  13. package/docs/api/utils/fastUse.md +246 -0
  14. package/docs/api/utils/getRect.md +238 -0
  15. package/docs/api/utils/guid.md +41 -0
  16. package/docs/api/utils/index.md +55 -0
  17. package/docs/api/utils/intro.md +25 -0
  18. package/docs/api/utils/object.md +171 -0
  19. package/docs/api/utils/queryParams.md +68 -0
  20. package/docs/api/utils/random.md +23 -0
  21. package/docs/api/utils/randomArray.md +28 -0
  22. package/docs/api/utils/route.md +121 -0
  23. package/docs/api/utils/test.md +237 -0
  24. package/docs/api/utils/time.md +81 -0
  25. package/docs/api/utils/trim.md +24 -0
  26. package/docs/components/actionSheet.md +236 -0
  27. package/docs/components/addQQGroup.md +5 -0
  28. package/docs/components/album.md +91 -0
  29. package/docs/components/alert.md +83 -0
  30. package/docs/components/avatar.md +152 -0
  31. package/docs/components/backTop.md +181 -0
  32. package/docs/components/badge.md +117 -0
  33. package/docs/components/button.md +196 -0
  34. package/docs/components/calendar.md +398 -0
  35. package/docs/components/calendars.md +294 -0
  36. package/docs/components/cell.md +185 -0
  37. package/docs/components/checkbox.md +281 -0
  38. package/docs/components/circleProgress.md +5 -0
  39. package/docs/components/code.md +162 -0
  40. package/docs/components/codeInput.md +175 -0
  41. package/docs/components/collapse.md +250 -0
  42. package/docs/components/color.md +324 -0
  43. package/docs/components/common.md +126 -0
  44. package/docs/components/countDown.md +166 -0
  45. package/docs/components/countTo.md +140 -0
  46. package/docs/components/datetimePicker.md +283 -0
  47. package/docs/components/diff1.x.md +190 -0
  48. package/docs/components/divider.md +88 -0
  49. package/docs/components/downloadSetting.md +54 -0
  50. package/docs/components/dropDown.md +375 -0
  51. package/docs/components/empty.md +99 -0
  52. package/docs/components/feature.md +261 -0
  53. package/docs/components/form.md +736 -0
  54. package/docs/components/gap.md +49 -0
  55. package/docs/components/grid.md +225 -0
  56. package/docs/components/icon.md +101 -0
  57. package/docs/components/image.md +182 -0
  58. package/docs/components/index.md +110 -0
  59. package/docs/components/indexList.md +133 -0
  60. package/docs/components/input.md +250 -0
  61. package/docs/components/install.md +59 -0
  62. package/docs/components/intro.md +32 -0
  63. package/docs/components/keyboard.md +226 -0
  64. package/docs/components/layout.md +310 -0
  65. package/docs/components/line.md +85 -0
  66. package/docs/components/lineProgress.md +141 -0
  67. package/docs/components/link.md +89 -0
  68. package/docs/components/list.md +223 -0
  69. package/docs/components/loadMore.md +140 -0
  70. package/docs/components/loadingIcon.md +144 -0
  71. package/docs/components/loadingPage.md +92 -0
  72. package/docs/components/modal.md +230 -0
  73. package/docs/components/more.md +13 -0
  74. package/docs/components/navbar.md +192 -0
  75. package/docs/components/noNetwork.md +116 -0
  76. package/docs/components/noticeBar.md +131 -0
  77. package/docs/components/notify.md +204 -0
  78. package/docs/components/npmSetting.md +64 -0
  79. package/docs/components/numberBox.md +257 -0
  80. package/docs/components/nvue.md +170 -0
  81. package/docs/components/overlay.md +117 -0
  82. package/docs/components/parse.md +204 -0
  83. package/docs/components/pickColor.md +112 -0
  84. package/docs/components/picker.md +357 -0
  85. package/docs/components/popup.md +221 -0
  86. package/docs/components/problem.md +300 -0
  87. package/docs/components/qrcode.md +169 -0
  88. package/docs/components/quickstart.md +33 -0
  89. package/docs/components/radio.md +256 -0
  90. package/docs/components/rate.md +128 -0
  91. package/docs/components/read.md +163 -0
  92. package/docs/components/readMore.md +227 -0
  93. package/docs/components/resource.md +17 -0
  94. package/docs/components/scrollList.md +218 -0
  95. package/docs/components/search.md +160 -0
  96. package/docs/components/setting.md +111 -0
  97. package/docs/components/settingDesc.md +66 -0
  98. package/docs/components/skeleton.md +105 -0
  99. package/docs/components/skeletons.md +323 -0
  100. package/docs/components/slider.md +157 -0
  101. package/docs/components/steps.md +189 -0
  102. package/docs/components/sticky.md +76 -0
  103. package/docs/components/subsection.md +183 -0
  104. package/docs/components/swipeAction.md +279 -0
  105. package/docs/components/swiper.md +352 -0
  106. package/docs/components/switch.md +216 -0
  107. package/docs/components/tabbar.md +263 -0
  108. package/docs/components/table.md +5 -0
  109. package/docs/components/tabs.md +364 -0
  110. package/docs/components/tag.md +227 -0
  111. package/docs/components/testPic.md +20 -0
  112. package/docs/components/text.md +157 -0
  113. package/docs/components/textarea.md +121 -0
  114. package/docs/components/toast.md +124 -0
  115. package/docs/components/tooltip.md +98 -0
  116. package/docs/components/transition.md +404 -0
  117. package/docs/components/upload.md +253 -0
  118. package/docs/components/vtabs.md +332 -0
  119. package/docs/components/vueUse.md +45 -0
  120. package/docs/components/vuexDetail.md +103 -0
  121. package/docs/components/waterfall.md +651 -0
  122. package/docs/faq/index.md +53 -0
  123. package/docs/guide/codeHint.md +44 -0
  124. package/docs/guide/customIcon.md +168 -0
  125. package/docs/guide/demo.md +92 -0
  126. package/docs/guide/design.md +56 -0
  127. package/docs/guide/globalVariable.md +239 -0
  128. package/docs/guide/i18n.md +194 -0
  129. package/docs/guide/index.md +28 -0
  130. package/docs/guide/note.md +74 -0
  131. package/docs/guide/safeAreaInset.md +64 -0
  132. package/docs/guide/theme.md +67 -0
  133. package/docs/index.md +88 -0
  134. package/libs/config/config.js +0 -10
  135. package/libs/css/color.scss +15 -14
  136. package/package.json +7 -2
  137. package/theme.scss +2 -1
@@ -0,0 +1,144 @@
1
+ ## LoadingIcon 加载动画 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsD/loading-icon/loading-icon"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-loading-icon**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-loading-icon)
10
+
11
+ :::
12
+
13
+ 此组件为一个小动画,目前用在uv-ui的[loadMore加载更多](https://www.uvui.cn/components/loadMore.html)等组件的正在加载状态场景。
14
+
15
+ ### 平台兼容性
16
+
17
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
18
+ |:-:|:-:|:-:|:-:|:-:|:-:|
19
+ |√|√|√|√|√|√|
20
+
21
+ ### 基本使用
22
+
23
+ 默认`mode="spinner"`为经典类似花朵的形状
24
+
25
+ ```vue
26
+ <template>
27
+ <uv-loading-icon></uv-loading-icon>
28
+ </template>
29
+ ```
30
+
31
+ ### 动画文字
32
+
33
+ `text`可以指定文字内容,`textSize`可以指定文字大小
34
+
35
+ ```vue
36
+ <template>
37
+ <uv-loading-icon text="加载中" textSize="30rpx"></uv-loading-icon>
38
+ </template>
39
+ ```
40
+
41
+ ### 模式类型
42
+
43
+ 通过`mode`设定动画的类型,`circle`为圆圈的形状,`semicircle`为半圆圈的形状,`spinner`为经典类似花朵的形状,默认`spinner`
44
+
45
+ :::warning 注意
46
+ `mode="spinner"`在`nvue`中使用的是`<loading-indicator>`,所以在`nvue`中不是花朵的效果,而是`weex`中默认的动画效果。
47
+ :::
48
+
49
+ ```vue
50
+ <template>
51
+ <view>
52
+ <uv-loading-icon mode="spinner" text="花朵形"></uv-loading-icon>
53
+ <uv-loading-icon mode="semicircle" text="半圆"></uv-loading-icon>
54
+ <uv-loading-icon mode="circle" text="圆型"></uv-loading-icon>
55
+ </view>
56
+ </template>
57
+ ```
58
+
59
+ ### 排列类型
60
+
61
+ `vertical`可以指定文字和图标是否垂直排列,默认`false`
62
+
63
+ ```vue
64
+ <template>
65
+ <view>
66
+ <uv-loading-icon :vertical="true" text="加载中"></uv-loading-icon>
67
+ </view>
68
+ </template>
69
+ ```
70
+
71
+ ### 动画模式
72
+
73
+ `timing-function`可以指定`mode`为`semicircle`或`circle`时动画里css中`animation-timing-function`的属性,默认为`ease-in-out`,[更多详见](https://www.runoob.com/cssref/css3-pr-animation-timing-function.html)
74
+
75
+ ```vue
76
+ <uv-loading-icon timing-function="linear"></uv-loading-icon>
77
+ ```
78
+
79
+ ### 动画运行时间
80
+
81
+ `duration`可以指定动画的运行周期时间
82
+
83
+ ```vue
84
+ <uv-loading-icon duration="2000"></uv-loading-icon>
85
+ ```
86
+
87
+ ### 图标颜色
88
+
89
+ `color`可以指定动画活动区域的颜色, `inactive-color`可以制定`mode`为`circle`时的暗边颜色
90
+
91
+ ```vue
92
+ <template>
93
+ <view>
94
+ <uv-loading-icon color="red"></uv-loading-icon>
95
+ <uv-loading-icon mode="circle" inactive-color="red"></uv-loading-icon>
96
+ </view>
97
+ </template>
98
+ ```
99
+
100
+ ### 图标尺寸
101
+
102
+ 通过`size`设定尺寸,单位rpx,组件内把`size`值体现为组件的宽和高
103
+
104
+ ```vue
105
+ <uv-loading-icon size="36rpx"></uv-loading-icon>
106
+ ```
107
+
108
+ ### 显示或隐藏动画
109
+
110
+ 通过`show`设置为`true`或`false`,来显示或隐藏动画
111
+
112
+ ```vue
113
+ <uv-loading-icon :show="true"></uv-loading-icon>
114
+
115
+ /* 等价于 */
116
+ <uv-loading-icon show></uv-loading-icon>
117
+ ```
118
+
119
+ ::: tip 完整示例下载地址
120
+
121
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
122
+
123
+ :::
124
+
125
+ ### API
126
+
127
+ ### LoadingIcon Props
128
+
129
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
130
+ | :- | :- | :- | :- | :- |
131
+ | show | 是否显示动画 | Boolean | true | true &#124; false |
132
+ | color | 图标颜色 | String | #909193 | - |
133
+ | textColor | 提示文本颜色 | String | #909193 | - |
134
+ | vertical | 图标和文字是否垂直排列 | Boolean | false | true &#124; false |
135
+ | mode | 模式选择,见上方[模式类型](/components/loadingIcon.html#模式类型) | String | circle | spinner &#124; circle &#124; semicircle |
136
+ | size | 加载图标的大小,默认单位px | String &#124; Number | 24 | - |
137
+ | textSize | 加载文字的大小,默认单位px | String &#124; Number | 15 | - |
138
+ | text | 文字内容 | String | - | - |
139
+ | textStyle | 文字样式 | Object | - | - |
140
+ | timingFunction| 指定`animation-timing-function`的css属性,但只支持`mode`为`circle`或`semicircle`才有效 | String | ease-in-out<br>[更多详见](https://www.runoob.com/cssref/css3-pr-animation-timing-function.html) | - |
141
+ | duration | 动画执行周期时间,单位ms | string &#124; Number | 1200 | - |
142
+ | inactiveColor | 图标的暗边颜色, `mode`为`circle` 模式有效 | String | transparent | - |
143
+
144
+
@@ -0,0 +1,92 @@
1
+ ## LoadingPage 加载页 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsD/loading-page/loading-page"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-loading-page**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-loading-page)
10
+
11
+ :::
12
+
13
+ 该组件是一个页面级的加载效果,可以在页面初始化数据等场景使用,与[骨架屏](/components/skeleton.html)有相似之处。
14
+
15
+ ### 平台兼容性
16
+
17
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
18
+ |:-:|:-:|:-:|:-:|:-:|:-:|
19
+ |√|√|√|√|√|√|
20
+
21
+ ### 基本使用
22
+
23
+ - `loading`属性为`true`或`false`,设置组件的显示或隐藏
24
+ - `loading-text`属性,设置提示文字
25
+ - `font-size`属性,设置提示大小
26
+
27
+ ```vue
28
+ <template>
29
+ <uv-loading-page :loading="true" loading-text="加载中..." font-size="24rpx"></uv-loading-page>
30
+ </template>
31
+ ```
32
+
33
+ ### 动画模式
34
+
35
+ `loading-mode`可以指定加载动画的模式,`circle`为圆圈的形状,`semicircle`为半圆圈的形状,`spinner`为经典类似花朵的形状, 默认为`circle`
36
+
37
+ ```vue
38
+ <template>
39
+ <uv-loading-page :loading="true" loading-mode="spinner"></uv-loading-page>
40
+ </template>
41
+ ```
42
+ ```vue
43
+ <template>
44
+ <uv-loading-page :loading="true" loading-mode="semicircle"></uv-loading-page>
45
+ </template>
46
+ ```
47
+
48
+ ### 动画图片
49
+
50
+ `image`可以指定文字上方用于替换loading动画的图片
51
+
52
+ ```vue
53
+ <template>
54
+ <uv-loading-page :loading="true" image="https://www.uvui.cn/common/logo.png"></uv-loading-page>
55
+ </template>
56
+ ```
57
+
58
+ ### 图标大小
59
+
60
+ `icon-size`可以指定图标大小
61
+
62
+ ```vue
63
+ <template>
64
+ <uv-loading-page :loading="true" icon-size="50rpx"></uv-loading-page>
65
+ </template>
66
+ ```
67
+
68
+ ::: tip 完整示例下载地址
69
+
70
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
71
+
72
+ :::
73
+
74
+ ### API
75
+ ---
76
+
77
+ ### LoadingPage Props
78
+
79
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
80
+ | :- | :- | :- | :- | :- |
81
+ | loadingText | 提示内容 | String &#124; Number | '' | - |
82
+ | image | 文字上方用于替换loading动画的图片 | String | - | - |
83
+ | loadingMode | 加载动画的模式 | String | circle | circle &#124; spinner &#124; semicircle |
84
+ | loading | 是否加载中 | boolean | false | true &#124; false |
85
+ | bgColor | 背景颜色 | String | #ffffff | - |
86
+ | color | 文字颜色 | String | #C8C8C8 | - |
87
+ | fontSize | 文字大小 | String &#124; Number | 19 | - |
88
+ | iconSize | 图标大小 | String &#124; Number | 28 | - |
89
+ | loadingColor | 加载中图标的颜色 | String | #C8C8C8 | - |
90
+
91
+
92
+
@@ -0,0 +1,230 @@
1
+ ## Modal 模态框 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsC/modal/modal"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-modal**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-modal)
10
+
11
+ :::
12
+
13
+ 弹出模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作。类似于`uniapp`官方API `uni.showModal(OBJECT)`。
14
+
15
+ ### 平台兼容性
16
+
17
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
18
+ |:-:|:-:|:-:|:-:|:-:|:-:|
19
+ |√|√|√|√|√|√|
20
+
21
+ ### 基本使用
22
+
23
+
24
+ 默认情况下,模态框只有一个`确认`按钮:
25
+ - 请至少要配置弹框的内容参数`content`。
26
+ - 通过`ref`调用`open()`控制组件的打开。
27
+
28
+ ```vue
29
+ <template>
30
+ <view>
31
+ <uv-modal ref="modal" title="标题" content='不知天上宫阙,今夕是何年' @confirm="confirm"></uv-modal>
32
+ <button @click="openModal">打开</button>
33
+ </view>
34
+ </template>
35
+ <script setup>
36
+ import { ref } from 'vue';
37
+
38
+ const modal = ref(null);
39
+ function openModal() {
40
+ modal.value.open();
41
+ }
42
+ function confirm() {
43
+ console.log('点击确认按钮');
44
+ }
45
+
46
+ </script>
47
+ ```
48
+
49
+ ### 传入富文本内容
50
+
51
+ 有时候我们需要给模态框的内容,不一定是纯文本的字符串,可能会需要换行,嵌入其他元素等。这时候我们可以使用`slot`功能,再结合`uni`官方提供的`rictText`组件,
52
+ 就能传入富文本内容了,如下:
53
+
54
+ ```vue
55
+ <template>
56
+ <view>
57
+ <uv-modal ref="modal" title="标题" @confirm="confirm">
58
+ <view class="slot-content">
59
+ <rich-text :nodes="content"></rich-text>
60
+ </view>
61
+ </uv-modal>
62
+ <button @click="openModal">打开</button>
63
+ </view>
64
+ </template>
65
+ <script setup>
66
+ import { ref } from 'vue';
67
+
68
+ const modal = ref(null);
69
+ const content = ref(`<p style="max-height:30px;overflow:auto;">空山新雨后<br>天气晚来秋空山</p>`);
70
+ function openModal() {
71
+ modal.value.open();
72
+ }
73
+ function confirm() {
74
+ console.log('点击确认按钮');
75
+ }
76
+
77
+ </script>
78
+ ```
79
+ :::warning 温馨提示
80
+ 如果想要在模态框中设置滚动内容,可以配合上述富文本使用,设置最大高度和允许滚动属性即可
81
+ :::
82
+
83
+ ### 自定义确定按钮
84
+
85
+ - 一般用于在微信小程序弹窗通过按钮授权等场景。
86
+ - 使用`ref`调用`close`方法手动关闭弹窗。
87
+
88
+ ```vue
89
+ <template>
90
+ <view>
91
+ <uv-modal ref="modal" title="水调歌头" content='不知天上宫阙,今夕是何年' @confirm="confirm">
92
+ <template v-slot:confirmButton>
93
+ <button type="default" @click="closeModal">自定义按钮</button>
94
+ </template>
95
+ </uv-modal>
96
+ <button @click="openModal">打开</button>
97
+ </view>
98
+ </template>
99
+ <script setup>
100
+ import { ref } from 'vue';
101
+
102
+ const modal = ref(null);
103
+ function openModal() {
104
+ modal.value.open();
105
+ }
106
+ function closeModal() {
107
+ modal.value.close();
108
+ }
109
+ function confirm() {
110
+ console.log('点击确认按钮');
111
+ }
112
+
113
+ </script>
114
+ ```
115
+
116
+ ### 异步关闭
117
+
118
+ 异步关闭只对“确定”按钮起作用,需要设置`asyncClose`为`true`,当点击确定按钮的时候,按钮的文字变成一个loading动画,此动画的颜色为
119
+ `confirm-color`参数的颜色,同时Modal不会自动关闭,可以使用`ref`调用`close`方法手动关闭弹窗,也可以使用`ref`调用`closeLoading`方法关闭loading动画。
120
+
121
+ ```vue
122
+ <template>
123
+ <view>
124
+ <uv-modal ref="modal" title="水调歌头" content='不知天上宫阙,今夕是何年' :asyncClose="true" @confirm="confirm"></uv-modal>
125
+ <button @click="openModal">打开</button>
126
+ </view>
127
+ </template>
128
+ <script setup>
129
+ import { ref } from 'vue';
130
+
131
+ const modal = ref(null);
132
+ function openModal() {
133
+ modal.value.open();
134
+ }
135
+ function confirm() {
136
+ console.log('点击确认按钮');
137
+ setTimeout(() => {
138
+ modal.value.close();
139
+ }, 2000);
140
+ }
141
+
142
+ </script>
143
+ ```
144
+
145
+ ### 控制模态框宽度
146
+
147
+ 可以通过`width`属性设置模态框的宽度,不支持百分比,单位`px(rpx)`
148
+
149
+ ```vue
150
+ <uv-modal ref="modal" content="不知天上宫阙,今夕是何年" width="500rpx"></uv-modal>
151
+ ```
152
+
153
+
154
+ ### 缩放效果
155
+
156
+ 默认开启缩放效果,在打开和收起模态框的时候,会带有缩放效果,具体效果请见示例,通过`zoom`属性配置
157
+
158
+ ```vue
159
+ <uv-modal ref="modal" content="不知天上宫阙,今夕是何年" :zoom="false"></uv-modal>
160
+ ```
161
+
162
+ ### 完整示例
163
+
164
+ ::: tip 完整示例下载地址
165
+
166
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
167
+
168
+ :::
169
+
170
+ ### API
171
+ ---
172
+
173
+ ### Modal Props
174
+
175
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
176
+ |:- |:- |:- |:- |:- |
177
+ | title | 标题内容 | String | - | - |
178
+ | content | 模态框内容,如传入`slot`内容,则此参数无效 | String | - | - |
179
+ | confirmText | 确认按钮的文字 | String | 确认 | - |
180
+ | cancelText | 取消按钮的文字 | String | 取消 | - |
181
+ | showConfirmButton | 是否显示确认按钮 | Boolean | true | true &#124; false |
182
+ | showCancelButton | 是否显示取消按钮 | Boolean | false | true &#124; false |
183
+ | confirmColor | 确认按钮的颜色 | String | #2979ff | - |
184
+ | cancelColor | 取消按钮的颜色 | String | #606266 | - |
185
+ | buttonReverse | 对调确认和取消的位置 | Boolean | false | true &#124; false |
186
+ | zoom | 是否开启缩放模式 | Boolean | true | true &#124; false |
187
+ | asyncClose | 是否异步关闭,只对确定按钮有效,见[异步关闭](/components/modal.html#异步关闭) | Boolean | false | true &#124; false |
188
+ | closeOnClickOverlay| 是否允许点击遮罩关闭该组件 | Boolean | true | true &#124; false |
189
+ | negativeTop | 往上偏移的值,给一个负的margin-top,往上偏移,避免和键盘重合的情况,单位任意,数值则默认为rpx单位 | String &#124; Number | 0 | - |
190
+ | width | modal宽度,不支持百分比,可以数值,单位`px(rpx)` | String &#124; Number | 650rpx | - |
191
+ | zIndex | 弹出层的层级 | Number &#124; String | 10075 | - |
192
+ | align <badge text="1.0.7"/> | 文本对齐方式 | String | left | left &#124; center &#124; right |
193
+ | textStyle <badge text="1.0.7"/> | 文本扩展样式 | Object | - | - |
194
+
195
+ ### Modal Methods
196
+
197
+ | 事件名 | 说明 |
198
+ | :- | :- |
199
+ | open | 弹出模态框组件 |
200
+ | close | 关闭模态框组件 |
201
+ | closeLoading | `:asyncClose="true"`异步关闭场景,验证通过则关闭,验证不通过不关闭且按钮恢复加载前的状态等场景,可以调用此方法关闭加载状态 |
202
+
203
+ ### Modal Events
204
+
205
+ |事件名 |说明 |回调参数 |
206
+ |:- |:- |:- |
207
+ | @confirm | 点击确认按钮时触发 | - |
208
+ | @cancel | 点击取消按钮时触发 | - |
209
+ | @close | 关闭模态框组件时触发 | - |
210
+
211
+ ### Modal Slots
212
+
213
+ | 名称 | 说明 |
214
+ |:- |:- |
215
+ | default | 传入自定义内容,一般为富文本,见上方说明 |
216
+ | confirmButton | 传入自定义按钮,用于在微信小程序弹窗通过按钮授权的场景 |
217
+
218
+
219
+ <style scoped>
220
+ h3[id=modal-events] + table thead tr th:nth-child(2){
221
+ width: 50%;
222
+ }
223
+
224
+ h3[id=modal-methods] + table thead tr th:nth-child(2){
225
+ width: 70%;
226
+ }
227
+ h3[id=modal-slots] + table thead tr th:nth-child(2){
228
+ width: 70%;
229
+ }
230
+ </style>
@@ -0,0 +1,13 @@
1
+ ## 其他小组件 <to-api/>
2
+
3
+ ### 平台兼容性
4
+
5
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
6
+ |:-:|:-:|:-:|:-:|:-:|:-:|
7
+ |√|√|√|√|√|√|
8
+
9
+ | 组件名 | 下载地址 | 说明 |
10
+ |:-|:-|:-|
11
+ | uv-status-bar | [https://ext.dcloud.net.cn/plugin?id=12290](https://ext.dcloud.net.cn/plugin?id=12290) | 状态栏占位,在uv-navbar、uv-popup、uv-notify等组件有复用该组件 |
12
+ | uv-safe-bottom | [https://ext.dcloud.net.cn/plugin?id=12292](https://ext.dcloud.net.cn/plugin?id=12292) | 底部安全区,在uv-popup、uv-tabbar等组件有复用该组件 |
13
+ | uv-toolbar | [https://ext.dcloud.net.cn/plugin?id=13896](https://ext.dcloud.net.cn/plugin?id=13896) | 工具条,在uv-picker、uv-pick-color等组件有复用该组件 |
@@ -0,0 +1,192 @@
1
+ ### Navbar 自定义导航栏 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsD/navbar/navbar"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-navbar**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-navbar)
10
+
11
+ :::
12
+
13
+ 该组件一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用`uni-app`带的导航栏。
14
+
15
+ ### 平台兼容性
16
+
17
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
18
+ |:-:|:-:|:-:|:-:|:-:|:-:|
19
+ |√|√|√|√|√|√|
20
+
21
+ ### 基本使用
22
+
23
+ 默认情况下,该组件只有向左的箭头,**点击**可以返回上一页,如果您想将自定义导航栏用在tabbar(不存在要返回的逻辑)页面,
24
+ 这样会隐藏左边的返回图标区域。
25
+
26
+ - 如果想在返回箭头的右边自定义类似“返回”字样,可以将`left-text`设置为“返回”
27
+ - 通过`title`参数传入需要显示的标题,通过`title-width`(rpx)设置标题区域的宽度,文字超出会通过省略号隐藏
28
+ - 通过`fixed`配置是否将导航栏固定在顶部
29
+
30
+ :::tip 说明
31
+ - 在小程序中,导航栏会自动适配导航栏右侧的胶囊位置,避开该区域
32
+ - 组件底部默认有一条下边框,如您不需要,可以设置`border`为`false`即可
33
+ :::
34
+
35
+ ```vue
36
+ <template>
37
+ <view>
38
+ <uv-navbar title="个人中心" @leftClick="leftClick"></uv-navbar>
39
+ </view>
40
+ </template>
41
+ <script setup>
42
+ function leftClick() {
43
+ console.log('leftClick');
44
+ }
45
+
46
+ </script>
47
+ ```
48
+
49
+ ### 注意事项
50
+
51
+ - 既然是要自定义导航栏,那么首先就要取消系统自带的导航栏,需要在`uni-app`目的根目录的"pages.json"中设置,同时在此设置状态栏字体的颜色(H5无效)。
52
+ - 自定义导航栏后,如果想通过`uni.setNavigationBarColor`动态设置导航栏颜色相关参数,是可能会出问题的,请勿使用此方式。
53
+
54
+ ```js
55
+ // pages.json
56
+ "pages": [
57
+ // navbar-自定义导航栏
58
+ {
59
+ "path": "/pages/navbar/index",
60
+ "style": {
61
+ "navigationStyle": "custom" ,// 隐藏系统导航栏
62
+ "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一
63
+ }
64
+ }
65
+ ]
66
+ ```
67
+
68
+ ### 导航栏高度
69
+
70
+ 可以通过`height`(单位`px`,默认44,和`uni-app`统导航栏高度一致)配置导航栏的高度,此高度为导航栏内容的高度,不含状态栏的高度,组件内部会自动加上状态栏的高度,并填充状态栏的占位区域。
71
+
72
+ ### 自定义导航栏内容
73
+
74
+ 通过自定义`slot`传入的内容
75
+
76
+ ```vue
77
+ <template>
78
+ <view>
79
+ <uv-navbar leftText="返回" :fixed="false" title="个人中心" :safeAreaInsetTop="false">
80
+ <template v-slot:left>
81
+ <view class="uv-nav-slot">
82
+ <uv-icon name="arrow-left" size="19"></uv-icon>
83
+ <uv-line direction="column" :hairline="false" length="16" margin="0 8px"></uv-line>
84
+ <uv-icon name="home" size="20"></uv-icon>
85
+ </view>
86
+ </template>
87
+ </uv-navbar>
88
+ </view>
89
+ </template>
90
+ <style scoped lang="scss">
91
+ @mixin flex($direction: row) {
92
+ /* #ifndef APP-NVUE */
93
+ display: flex;
94
+ /* #endif */
95
+ flex-direction: $direction;
96
+ }
97
+ .uv-nav-slot {
98
+ @include flex;
99
+ align-items: center;
100
+ justify-content: space-between;
101
+ border-width: 0.5px;
102
+ border-radius: 100px;
103
+ border-color: #dadbde;
104
+ padding: 3px 7px;
105
+ opacity: 0.8;
106
+ }
107
+ </style>
108
+ ```
109
+
110
+ ### 导航栏背景颜色
111
+
112
+ `uv-ui`提供了一个`bgColor`参数,可以自定义导航栏的背景颜色,支持如下:
113
+
114
+ - 普通颜色值
115
+ - 透明度
116
+ - 渐变色
117
+
118
+ ```vue
119
+ <template>
120
+ <view>
121
+ <!-- 普通颜色 -->
122
+ <uv-navbar title="个人中心" bgColor="#c0c4cc"></uv-navbar>
123
+ <!-- 透明色 -->
124
+ <uv-navbar title="个人中心" bg-color="rgba(0,0,0,.5)"></uv-navbar>
125
+ <!-- 渐变色 -->
126
+ <uv-navbar
127
+ title="个人中心"
128
+ bg-color="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))">
129
+ </uv-navbar>
130
+ <!-- 背景图片 -->
131
+ <uv-navbar
132
+ title="个人中心"
133
+ bg-color="https://via.placeholder.com/400x200.png/3c9cff/fff"
134
+ imgMode="aspectFit">
135
+ </uv-navbar>
136
+ </view>
137
+ </template>
138
+ ```
139
+
140
+ ### 完整示例
141
+
142
+ ::: tip 完整示例下载地址
143
+
144
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
145
+
146
+ :::
147
+
148
+ ### API
149
+ ---
150
+
151
+ ### NavBar Props
152
+
153
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
154
+ | :- | :- | :- | :- | :- |
155
+ | title | 导航栏标题,如设置为空字符,将会隐藏标题占位区域 | String | - | - |
156
+ | safeAreaInsetTop | 是否开启顶部安全区适配 | Boolean | true | true &#124; false |
157
+ | placeholder | 固定在顶部时,是否生成一个等高元素,以防止塌陷 | Boolean | false | true &#124; false |
158
+ | fixed | 导航栏是否固定在顶部 | Boolean | true | true &#124; false |
159
+ | border | 导航栏底部是否显示下边框 | Boolean | false | true &#124; false |
160
+ | leftIcon | 左边返回图标的名称,只能为`uv-ui`自带的图标 | String | arrow-left| - |
161
+ | leftText | 左边的提示文字 | String | - | - |
162
+ | rightText | 右边的提示文字 | String | - | - |
163
+ | rightIcon | 右边返回图标的名称,只能为`uv-ui`自带的图标 | String | - | - |
164
+ | bgColor | 导航栏背景设置,支持渐变色,支持图片背景 | String | #ffffff | - |
165
+ | imgMode | `bgColor`为图片时,可以通过此属性设置裁剪模式 | String | aspectFill | 更多模式参考[image](https://uniapp.dcloud.net.cn/component/image.html) |
166
+ | titleWidth | 导航栏标题的最大宽度,内容超出会以省略号隐藏,单位`px(rpx)` | String &#124; Number | 400rpx | - |
167
+ | height | 导航栏高度(不包括状态栏高度在内,内部自动加上),单位`px(rpx)` | String &#124; Number | 44px | - |
168
+ | leftIconSize | 左侧返回图标的大小 | String &#124; Number | 20px | - |
169
+ | leftIconColor | 左侧返回图标的颜色 | String | #303133 | - |
170
+ | autoBack | 点击左侧区域(返回图标),是否自动返回上一页 | Boolean | false | true &#124; false |
171
+ | titleStyle | 标题的样式,对象或字符串形式 | String &#124; Object | - | - |
172
+
173
+ ### NavBar Events
174
+
175
+ | 名称 | 参数 | 说明 |
176
+ | :- | :- | :- |
177
+ | @leftClick | - | 点击左侧区域 |
178
+ | @rightClick| - | 点击右侧区域 |
179
+
180
+ ### NavBar Slots
181
+
182
+ | 名称 | 说明 |
183
+ | :- | :- |
184
+ | left | 自定义左侧部分内容 |
185
+ | right | 自定义右侧部分内容 |
186
+ | center | 自定义中部内容 |
187
+
188
+ <style scoped>
189
+ h3[id=navbar-slots] + table thead tr th:nth-child(2){
190
+ width: 70%;
191
+ }
192
+ </style>