@gmcb/uv-ui 0.2.27 → 0.3.1

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 (135) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +21 -0
  3. package/README.md +95 -141
  4. package/docs/api/configs/color.md +52 -0
  5. package/docs/api/index.md +77 -0
  6. package/docs/api/mixins/mpShare.md +95 -0
  7. package/docs/api/request/apiManage.md +88 -0
  8. package/docs/api/request/http.md +451 -0
  9. package/docs/api/utils/colorSwitch.md +78 -0
  10. package/docs/api/utils/debounce.md +104 -0
  11. package/docs/api/utils/fastUse.md +246 -0
  12. package/docs/api/utils/getRect.md +238 -0
  13. package/docs/api/utils/guid.md +41 -0
  14. package/docs/api/utils/index.md +55 -0
  15. package/docs/api/utils/intro.md +25 -0
  16. package/docs/api/utils/object.md +171 -0
  17. package/docs/api/utils/queryParams.md +68 -0
  18. package/docs/api/utils/random.md +23 -0
  19. package/docs/api/utils/randomArray.md +28 -0
  20. package/docs/api/utils/route.md +121 -0
  21. package/docs/api/utils/test.md +237 -0
  22. package/docs/api/utils/time.md +81 -0
  23. package/docs/api/utils/trim.md +24 -0
  24. package/docs/components/actionSheet.md +236 -0
  25. package/docs/components/addQQGroup.md +5 -0
  26. package/docs/components/album.md +91 -0
  27. package/docs/components/alert.md +83 -0
  28. package/docs/components/avatar.md +152 -0
  29. package/docs/components/backTop.md +181 -0
  30. package/docs/components/badge.md +117 -0
  31. package/docs/components/button.md +196 -0
  32. package/docs/components/calendar.md +398 -0
  33. package/docs/components/calendars.md +294 -0
  34. package/docs/components/cell.md +185 -0
  35. package/docs/components/checkbox.md +281 -0
  36. package/docs/components/circleProgress.md +5 -0
  37. package/docs/components/code.md +162 -0
  38. package/docs/components/codeInput.md +175 -0
  39. package/docs/components/collapse.md +250 -0
  40. package/docs/components/color.md +324 -0
  41. package/docs/components/common.md +126 -0
  42. package/docs/components/countDown.md +166 -0
  43. package/docs/components/countTo.md +140 -0
  44. package/docs/components/datetimePicker.md +283 -0
  45. package/docs/components/diff1.x.md +190 -0
  46. package/docs/components/divider.md +88 -0
  47. package/docs/components/downloadSetting.md +54 -0
  48. package/docs/components/dropDown.md +375 -0
  49. package/docs/components/empty.md +99 -0
  50. package/docs/components/feature.md +261 -0
  51. package/docs/components/form.md +736 -0
  52. package/docs/components/gap.md +49 -0
  53. package/docs/components/grid.md +225 -0
  54. package/docs/components/icon.md +101 -0
  55. package/docs/components/image.md +182 -0
  56. package/docs/components/index.md +110 -0
  57. package/docs/components/indexList.md +133 -0
  58. package/docs/components/input.md +250 -0
  59. package/docs/components/install.md +59 -0
  60. package/docs/components/intro.md +32 -0
  61. package/docs/components/keyboard.md +226 -0
  62. package/docs/components/layout.md +310 -0
  63. package/docs/components/line.md +85 -0
  64. package/docs/components/lineProgress.md +141 -0
  65. package/docs/components/link.md +89 -0
  66. package/docs/components/list.md +223 -0
  67. package/docs/components/loadMore.md +140 -0
  68. package/docs/components/loadingIcon.md +144 -0
  69. package/docs/components/loadingPage.md +92 -0
  70. package/docs/components/modal.md +230 -0
  71. package/docs/components/more.md +13 -0
  72. package/docs/components/navbar.md +192 -0
  73. package/docs/components/noNetwork.md +116 -0
  74. package/docs/components/noticeBar.md +131 -0
  75. package/docs/components/notify.md +204 -0
  76. package/docs/components/npmSetting.md +64 -0
  77. package/docs/components/numberBox.md +257 -0
  78. package/docs/components/nvue.md +170 -0
  79. package/docs/components/overlay.md +117 -0
  80. package/docs/components/parse.md +204 -0
  81. package/docs/components/pickColor.md +112 -0
  82. package/docs/components/picker.md +357 -0
  83. package/docs/components/popup.md +221 -0
  84. package/docs/components/problem.md +300 -0
  85. package/docs/components/qrcode.md +169 -0
  86. package/docs/components/quickstart.md +33 -0
  87. package/docs/components/radio.md +256 -0
  88. package/docs/components/rate.md +128 -0
  89. package/docs/components/read.md +163 -0
  90. package/docs/components/readMore.md +227 -0
  91. package/docs/components/resource.md +17 -0
  92. package/docs/components/scrollList.md +218 -0
  93. package/docs/components/search.md +160 -0
  94. package/docs/components/setting.md +111 -0
  95. package/docs/components/settingDesc.md +66 -0
  96. package/docs/components/skeleton.md +105 -0
  97. package/docs/components/skeletons.md +323 -0
  98. package/docs/components/slider.md +157 -0
  99. package/docs/components/steps.md +189 -0
  100. package/docs/components/sticky.md +76 -0
  101. package/docs/components/subsection.md +183 -0
  102. package/docs/components/swipeAction.md +279 -0
  103. package/docs/components/swiper.md +352 -0
  104. package/docs/components/switch.md +216 -0
  105. package/docs/components/tabbar.md +263 -0
  106. package/docs/components/table.md +5 -0
  107. package/docs/components/tabs.md +364 -0
  108. package/docs/components/tag.md +227 -0
  109. package/docs/components/testPic.md +20 -0
  110. package/docs/components/text.md +157 -0
  111. package/docs/components/textarea.md +121 -0
  112. package/docs/components/toast.md +124 -0
  113. package/docs/components/tooltip.md +98 -0
  114. package/docs/components/transition.md +404 -0
  115. package/docs/components/upload.md +253 -0
  116. package/docs/components/vtabs.md +332 -0
  117. package/docs/components/vueUse.md +45 -0
  118. package/docs/components/vuexDetail.md +103 -0
  119. package/docs/components/waterfall.md +651 -0
  120. package/docs/faq/index.md +53 -0
  121. package/docs/guide/codeHint.md +44 -0
  122. package/docs/guide/customIcon.md +168 -0
  123. package/docs/guide/demo.md +92 -0
  124. package/docs/guide/design.md +56 -0
  125. package/docs/guide/globalVariable.md +239 -0
  126. package/docs/guide/i18n.md +194 -0
  127. package/docs/guide/index.md +28 -0
  128. package/docs/guide/note.md +74 -0
  129. package/docs/guide/safeAreaInset.md +64 -0
  130. package/docs/guide/theme.md +67 -0
  131. package/docs/index.md +88 -0
  132. package/libs/config/config.js +0 -10
  133. package/libs/css/color.scss +15 -14
  134. package/package.json +7 -2
  135. package/theme.scss +2 -1
@@ -0,0 +1,226 @@
1
+ ## Keyboard 键盘 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsB/keyboard/keyboard"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-keyboard**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-keyboard)
10
+
11
+ :::
12
+
13
+ 此为uv-ui自定义的键盘面板,内含了数字键盘,车牌号键,身份证号键盘3种模式,都有可以打乱按键顺序的选项。
14
+
15
+ ### 平台兼容性
16
+
17
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
18
+ |:-:|:-:|:-:|:-:|:-:|:-:|
19
+ |√|√|√|√|√|√|
20
+
21
+ ### 基本使用
22
+
23
+ 通过`mode`参数定义键盘的类型,通过`ref`调用`open()`控制组件的打开和关闭:
24
+ - `mode = "car"` (默认值)为汽车键盘,此时顶部工具条中间的提示文字为"车牌号键盘"
25
+ - `mode = "number"`为数字键盘,此时顶部工具条中间的提示文字为"数字键盘"
26
+ - `mode = "card"` 为身份证键盘,此时顶部工具条中间的提示文字为"身份证键盘"
27
+
28
+ ```vue
29
+ <template>
30
+ <view>
31
+ <uv-keyboard ref="keyboard" mode="car" @change="change" @confirm="confirm"></uv-keyboard>
32
+ <button @click="open">打开</button>
33
+ </view>
34
+ </template>
35
+ <script setup>
36
+ import { ref } from 'vue';
37
+
38
+ const keyboard = ref(null);
39
+ function open() {
40
+ keyboard.value.open();
41
+ }
42
+ function change(e) {
43
+ console.log('change', e);
44
+ }
45
+ function confirm() {
46
+ console.log('confirm');
47
+ }
48
+
49
+ </script>
50
+ ```
51
+
52
+ ### 隐藏键盘"."符号
53
+
54
+ - 通过`dotDisabled`参数配置是否显示键盘"."符号,默认为`false`,只在`mode = "number"`时生效
55
+
56
+ ```vue
57
+ <uv-keyboard ref="keyboard" mode="number" :dotDisabled="true"></uv-keyboard>
58
+ ```
59
+
60
+ ### 是否打乱按键的顺序
61
+
62
+ 如果配置`random`参数为`true`的话,**每次**打开键盘,按键的顺序都是随机的,该功能默认是关闭的
63
+
64
+ ```vue
65
+ <uv-keyboard ref="keyboard" mode="number" random></uv-keyboard>
66
+ ```
67
+
68
+ ### 监听键盘按键被点击
69
+
70
+ - 输入值是通过组件的`change`事件实现的,组件内部每个按键被点击的时候,组件就会发出一个`change`事件,回调参数为点击的按键的值
71
+ - 通过`backspace`事件监听键盘退格键的点击,通过修改父组件的值实现退格的效果,见下方示例
72
+
73
+ 注意:点击退格键(也即删除键)不会触发`change`事件
74
+
75
+ ```vue
76
+ <template>
77
+ <view>
78
+ <uv-keyboard ref="keyboard" mode="number" @change="change" @backspace="backspace"></uv-keyboard>
79
+ <button @click="open">打开</button>
80
+ </view>
81
+ </template>
82
+ <script setup>
83
+ import { ref } from 'vue';
84
+
85
+ const keyboard = ref(null);
86
+ const value = ref('');
87
+ function open() {
88
+ keyboard.value.open();
89
+ }
90
+ function change(val) {
91
+ // 将每次按键的值拼接到value变量中,注意+=写法
92
+ value.value += val;
93
+ console.log(value.value);
94
+ }
95
+ function backspace() {
96
+ // 删除value的最后一个字符
97
+ if (value.value.length) value.value = value.value.substr(0, value.value.length - 1);
98
+ console.log(value.value);
99
+ }
100
+
101
+ </script>
102
+ ```
103
+
104
+ ### 车牌键盘自定义中英文切换及禁用键等设置
105
+
106
+ - 通过 `disKeys` 属性设置禁用的键,如:['京',2,'Q','X']
107
+ - 通过ref方法 `changeCarMode` 可以切换中英文模式
108
+ - 通过 `@changeCarInputMode` 回调方法可以获取是否处于英文状态模式,这里的作用是自定义中英文部分的内容
109
+ - 通过 `customabc` 属性开启自定义切换按键内容,为了兼容部分小程序
110
+
111
+ ```vue
112
+ <template>
113
+ <view>
114
+ <uv-keyboard
115
+ ref="keyboard"
116
+ mode="car"
117
+ customabc
118
+ :disKeys="['京',2,'Q','X']"
119
+ @change="change"
120
+ @confirm="confirm"
121
+ @changeCarInputMode="changeCarInputMode"
122
+ >
123
+ <template v-slot:abc>
124
+ <text v-if="isABC">省份</text>
125
+ <text v-else>ABC</text>
126
+ </template>
127
+ </uv-keyboard>
128
+ <button @click="open">打开</button>
129
+ </view>
130
+ </template>
131
+ <script setup>
132
+ import { ref } from 'vue';
133
+
134
+ const keyboard = ref(null);
135
+ const isABC = ref(false);
136
+ function open() {
137
+ keyboard.value.open();
138
+ // setTimeout(()=>{
139
+ // keyboard.value.changeCarMode();
140
+ // },1000)
141
+ }
142
+ function change(e) {
143
+ console.log('change', e);
144
+ }
145
+ function confirm() {
146
+ console.log('confirm');
147
+ }
148
+ function changeCarInputMode(e) {
149
+ isABC.value = e;
150
+ }
151
+
152
+ </script>
153
+ ```
154
+
155
+ ### 完整示例
156
+
157
+ ::: tip 完整示例下载地址
158
+
159
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
160
+
161
+ :::
162
+
163
+ ### API
164
+ ---
165
+
166
+ ### Keyboard Props
167
+
168
+
169
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
170
+ | :- | :- | :- | :- | :- |
171
+ | mode | 键盘的类型,`number` - 数字键盘,`card` - 身份证键盘,`car` - 车牌号键盘 | String | car | car &#124; number &#124; card |
172
+ | dotDisabled | 是否显示"."按键,只在`mode="number"`时有效 | Boolean | false | true &#124; false |
173
+ | tooltip | 是否显示键盘顶部工具条 | Boolean | true | true &#124; false |
174
+ | showTips | 是否显示工具条中间的提示 | Boolean | true | true &#124; false |
175
+ | tips | 工具条中间的提示文字 | String | - | - |
176
+ | showCancel | 是否显示工具条左边的"取消"按钮 | Boolean | true | true &#124; false |
177
+ | showConfirm | 是否显示工具条右边的"完成"按钮 | Boolean | true | true &#124; false |
178
+ | random | 是否打乱键盘按键的顺序 | Boolean | false | true &#124; false |
179
+ | safeAreaInsetBottom | 是否开启[底部安全区适配](/guide/safeAreaInset.html#关于uv-ui某些组件safe-area-inset参数的说明) | Boolean | false | true &#124; false |
180
+ | closeOnClickOverlay | 是否允许点击遮罩收起键盘 | Boolean | true | true &#124; false |
181
+ | closeOnClickConfirm | 是否允许点击确认按钮收起键盘 | Boolean | true | true &#124; false |
182
+ | overlay | 是否显示遮罩 | Boolean | true | true &#124; false |
183
+ | zIndex | 弹出键盘的`z-index`值 | String &#124; Number | 1075 | - |
184
+ | confirmText | 确认按钮的文字 | String | 确认 | - |
185
+ | cancelText | 取消按钮的文字 | String | 取消 | - |
186
+ | autoChange | `mode = "car"`下,输入文字后,是否自动切换为字母模式 | Boolean | false | true &#124; false |
187
+ | disKeys | `mode = "car"`下,被禁用的键,如:['I','O'] | Array | - | - |
188
+ | customabc | `mode = "car"`下,是否启用自定义中英文切换内容模式,为了兼容支付宝等小程序不兼容嵌套插槽,导致同时显示自定义内容和原始内容 | Array | - | - |
189
+ | customStyle | 自定义外部样式 | Object | {} | - |
190
+
191
+ ### Keyboard Methods
192
+ | 方法名 | 说明 |
193
+ | :- | :- |
194
+ | open | 弹出键盘组件 |
195
+ | close | 关闭键盘组件 |
196
+ | changeCarMode | `mode = "car"`下, 调用此方法可以切换中英文模式 |
197
+
198
+ ### Keyboard Events
199
+
200
+ | 事件名 | 说明 | 回调参数 |
201
+ | :- | :- | :- |
202
+ | @change | 按键被点击(不包含退格键被点击) | 按键的值,见上方说明和示例 |
203
+ | @close | 键盘关闭 | - |
204
+ | @confirm | 键盘顶部工具条右边的"完成"按钮被点击 | - |
205
+ | @cancel | 键盘顶部工具条左边的"取消"按钮被点击 | - |
206
+ | @backspace | 键盘退格键被点击 | - |
207
+ | @changeCarInputMode | `mode = "car"`下,调用此方法可以进行切换中英文 | 返回true - 英文模式;false - 中文模式 |
208
+
209
+ ### Keyboard slots
210
+
211
+ |名称 | 说明 |
212
+ |:- |:- |
213
+ | abc | `mode = "car"`下,自定义中英文切换内容,具体使用参考[上面示例]() |
214
+
215
+ <style scoped>
216
+ h3[id=keyboard-events] + table thead tr th:nth-child(2){
217
+ width: 40%;
218
+ }
219
+ h3[id=keyboard-methods] + table thead tr th:nth-child(2){
220
+ width: 70%;
221
+ }
222
+ h3[id=keyboard-slots] + table thead tr th:nth-child(2)
223
+ {
224
+ width: 80%;
225
+ }
226
+ </style>
@@ -0,0 +1,310 @@
1
+ ## Layout 布局 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsA/layout/layout"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-row**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-row)
10
+
11
+ :::
12
+
13
+ 通过基础的 12 分栏,迅速简便地创建布局
14
+
15
+ ### 平台兼容性
16
+
17
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
18
+ |:-:|:-:|:-:|:-:|:-:|:-:|
19
+ |√|√|√|√(仅支持微信小程序,[原因](https://www.uvui.cn/components/problem.html#%E4%B8%83%E3%80%81uv-row%E3%80%81uv-grid%E7%AD%89%E7%BB%84%E4%BB%B6%E5%9C%A8%E7%99%BE%E5%BA%A6%E5%B0%8F%E7%A8%8B%E5%BA%8F%E3%80%81%E6%8A%96%E9%9F%B3%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%AD%89%E5%B9%B3%E5%8F%B0%E6%98%BE%E7%A4%BA%E5%BC%82%E5%B8%B8))|√|√|
20
+
21
+ ::: warning 注意
22
+ 1、如需实现类似宫格的布局,请使用uv-ui的[Grid宫格组件](/components/grid.html),可以设置角标,功能更完善和灵活。
23
+
24
+ 2、百度小程序、抖音小程序等由于不支持[将自定义节点设置成虚拟的,更加接近Vue组件的表现](https://uniapp.dcloud.net.cn/tutorial/vue-api.html#%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE),所以表现可能有异常,这点需要开发时注意。
25
+ :::
26
+
27
+ ### 基本使用
28
+
29
+ 通过`col`组件的`span`设置需要分栏的比例
30
+
31
+ ```vue
32
+ <template>
33
+ <view>
34
+ <uv-row customStyle="margin-bottom: 10px">
35
+ <uv-col span="6">
36
+ <view class="demo-layout bg-purple-light"></view>
37
+ </uv-col>
38
+ <uv-col span="6">
39
+ <view class="demo-layout bg-purple"></view>
40
+ </uv-col>
41
+ </uv-row>
42
+ <uv-row customStyle="margin-bottom: 10px">
43
+ <uv-col span="4">
44
+ <view class="demo-layout bg-purple"></view>
45
+ </uv-col>
46
+ <uv-col span="4">
47
+ <view class="demo-layout bg-purple-light"></view>
48
+ </uv-col>
49
+ <uv-col span="4">
50
+ <view class="demo-layout bg-purple-dark"></view>
51
+ </uv-col>
52
+ </uv-row>
53
+ <uv-row justify="space-between">
54
+ <uv-col span="3">
55
+ <view class="demo-layout bg-purple"></view>
56
+ </uv-col>
57
+ <uv-col span="3">
58
+ <view class="demo-layout bg-purple-light"></view>
59
+ </uv-col>
60
+ <uv-col span="3">
61
+ <view class="demo-layout bg-purple"></view>
62
+ </uv-col>
63
+ <uv-col span="3">
64
+ <view class="demo-layout bg-purple-light"></view>
65
+ </uv-col>
66
+ </uv-row>
67
+ </view>
68
+ </template>
69
+ <style lang="scss">
70
+ .demo-layout {
71
+ height: 25px;
72
+ border-radius: 4px;
73
+ }
74
+ .bg-purple {
75
+ background: #CED7E1;
76
+ }
77
+ .bg-purple-light {
78
+ background: #e5e9f2;
79
+ }
80
+ .bg-purple-dark {
81
+ background: #99a9bf;
82
+ }
83
+ </style>
84
+ ```
85
+
86
+ ### 分栏间隔
87
+
88
+ 通过设置`row`组件的`gutter`参数,来指定每一栏之间的间隔(最终表现为左边内边距各为gutter/2),默认间隔为0
89
+
90
+ ```vue
91
+ <template>
92
+ <view>
93
+ <uv-row justify="space-between" gutter="10">
94
+ <uv-col span="3">
95
+ <view class="demo-layout bg-purple"></view>
96
+ </uv-col>
97
+ <uv-col span="3">
98
+ <view class="demo-layout bg-purple-light"></view>
99
+ </uv-col>
100
+ <uv-col span="3">
101
+ <view class="demo-layout bg-purple"></view>
102
+ </uv-col>
103
+ <uv-col span="3">
104
+ <view class="demo-layout bg-purple-light"></view>
105
+ </uv-col>
106
+ </uv-row>
107
+ </view>
108
+ </template>
109
+ <style lang="scss">
110
+ .demo-layout {
111
+ height: 25px;
112
+ border-radius: 4px;
113
+ }
114
+ .bg-purple {
115
+ background: #CED7E1;
116
+ }
117
+ .bg-purple-light {
118
+ background: #e5e9f2;
119
+ }
120
+ .bg-purple-dark {
121
+ background: #99a9bf;
122
+ }
123
+ </style>
124
+ ```
125
+
126
+ ### 混合布局
127
+
128
+ 通过指定`col`组件的`span`属性,指定不同的值,达到不同的比例
129
+
130
+ ```vue
131
+ <template>
132
+ <view>
133
+ <uv-row justify="space-between" gutter="10">
134
+ <uv-col span="2">
135
+ <view class="demo-layout bg-purple-light"></view>
136
+ </uv-col>
137
+ <uv-col span="4">
138
+ <view class="demo-layout bg-purple"></view>
139
+ </uv-col>
140
+ <uv-col span="6">
141
+ <view class="demo-layout bg-purple-dark"></view>
142
+ </uv-col>
143
+ </uv-row>
144
+ </view>
145
+ </template>
146
+ <style lang="scss">
147
+ .demo-layout {
148
+ height: 25px;
149
+ border-radius: 4px;
150
+ }
151
+ .bg-purple {
152
+ background: #CED7E1;
153
+ }
154
+ .bg-purple-light {
155
+ background: #e5e9f2;
156
+ }
157
+ .bg-purple-dark {
158
+ background: #99a9bf;
159
+ }
160
+ </style>
161
+ ```
162
+
163
+ ### 分栏偏移
164
+
165
+ 通过指定`col`组件的`offset`属性可以指定分栏偏移的栏数。
166
+
167
+ ```vue
168
+ <template>
169
+ <view>
170
+ <uv-row justify="space-between" customStyle="margin-bottom: 10px">
171
+ <uv-col span="3" offset="3">
172
+ <view class="demo-layout bg-purple-light"></view>
173
+ </uv-col>
174
+ <uv-col span="3" offset="3">
175
+ <view class="demo-layout bg-purple"></view>
176
+ </uv-col>
177
+ </uv-row>
178
+ <uv-row>
179
+ <uv-col span="3">
180
+ <view class="demo-layout bg-purple-light"></view>
181
+ </uv-col>
182
+ <uv-col span="3" offset="3">
183
+ <view class="demo-layout bg-purple"></view>
184
+ </uv-col>
185
+ </uv-row>
186
+ </view>
187
+ </template>
188
+ <style lang="scss">
189
+ .demo-layout {
190
+ height: 25px;
191
+ border-radius: 4px;
192
+ }
193
+ .bg-purple {
194
+ background: #CED7E1;
195
+ }
196
+ .bg-purple-light {
197
+ background: #e5e9f2;
198
+ }
199
+ .bg-purple-dark {
200
+ background: #99a9bf;
201
+ }
202
+ </style>
203
+ ```
204
+
205
+ ### 对齐方式
206
+
207
+ 通过`row`组件的`justify`来对分栏进行灵活的对齐,
208
+ 可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`),
209
+ 其最终的表现类似于css的`justify-content`属性。
210
+
211
+ **注意**:由于持微信小程序编译后的特殊结构,此方式不支持微信小程序。
212
+
213
+ ```vue
214
+ <template>
215
+ <view>
216
+ <uv-row justify="space-between" customStyle="margin-bottom: 10px">
217
+ <uv-col span="3">
218
+ <view class="demo-layout bg-purple-light"></view>
219
+ </uv-col>
220
+ <uv-col span="3">
221
+ <view class="demo-layout bg-purple"></view>
222
+ </uv-col>
223
+ </uv-row>
224
+ <uv-row>
225
+ <uv-col span="3">
226
+ <view class="demo-layout bg-purple-light"></view>
227
+ </uv-col>
228
+ <uv-col span="3">
229
+ <view class="demo-layout bg-purple"></view>
230
+ </uv-col>
231
+ </uv-row>
232
+ </view>
233
+ </template>
234
+ <style lang="scss">
235
+ .demo-layout {
236
+ height: 25px;
237
+ border-radius: 4px;
238
+ }
239
+ .bg-purple {
240
+ background: #CED7E1;
241
+ }
242
+ .bg-purple-light {
243
+ background: #e5e9f2;
244
+ }
245
+ .bg-purple-dark {
246
+ background: #99a9bf;
247
+ }
248
+ </style>
249
+ ```
250
+
251
+ ### 完整示例
252
+
253
+ ::: tip 完整示例下载地址
254
+
255
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
256
+
257
+ :::
258
+
259
+ ### API
260
+ ---
261
+
262
+ ### Row Props
263
+
264
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
265
+ |:- |:- |:- |:- |:- |
266
+ | gutter | 栅格间隔,左右各为此值的一半,单位任意 | String &#124; Number | 0 | - |
267
+ | justify | 水平排列方式(微信小程序暂不支持) | String | `start`(或`flex-start`) | 见下[Justify Options](/components/layout.html#justify-options)|
268
+ | align | 垂直排列方式 | String | center | top &#124; bottom |
269
+
270
+ ### Col Props
271
+
272
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
273
+ |:- |:- |:- |:- |:- |
274
+ | span | 栅格占据的列数,总12等分 | String &#124; Number | 0 | 1-12 |
275
+ | offset | 分栏左边偏移,计算方式与`span`相同 | String &#124; Number | 0 | - |
276
+ | justify | 水平排列方式 | String | start | 见下[Justify Options](/components/layout.html#justify-options) |
277
+ | align | 垂直对齐方式 | String | stretch | top &#124; center &#124; bottom &#124; stretch |
278
+ | textAlign | 文字水平对齐方式 | String | left | center &#124; right |
279
+
280
+ ### Justify Options
281
+
282
+ | 属性值 | 说明 |
283
+ |:- |:- |
284
+ | start (或flex-start) | 左对齐 |
285
+ | end (或flex-end) | 右对齐 |
286
+ | center | 居中对齐 |
287
+ | around (或space-around) | 每个项目两侧的间隔相等,所以项目之间的间隔比项目与边缘的间隔大一倍 |
288
+ | between (或space-between) | 两端对齐主轴的起点与终点,项目之间的间隔都相等 |
289
+
290
+ ### Row Events
291
+
292
+ |事件名 |说明 |回调参数 |
293
+ |:- |:- |:- |
294
+ | @click | `row`被点击 | - |
295
+
296
+
297
+ ### Col Events
298
+
299
+ |事件名 |说明 |回调参数 |
300
+ |:- |:- |:- |
301
+ | @click | `col`被点击,会阻止事件冒泡到`row` | - |
302
+
303
+ <style scoped>
304
+ h3[id=justify-options] + table {
305
+ width: auto;
306
+ }
307
+ h3[id=justify-options] + table thead tr th:nth-child(2) {
308
+ width: 60%;
309
+ }
310
+ </style>
@@ -0,0 +1,85 @@
1
+ ## Line 线条 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsA/line/line"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-line**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-line)
10
+
11
+ :::
12
+
13
+ 此组件一般用于显示一根线条,用于分隔内容块,有横向和竖向两种模式,且能设置0.5px线条,使用也很简单。
14
+
15
+
16
+ ### 平台兼容性
17
+
18
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
19
+ |:-:|:-:|:-:|:-:|:-:|:-:|
20
+ |√|√|√|√|√|√|
21
+
22
+ ### 基本使用
23
+
24
+ 组件内部有预置的参数,直接使用即可,有如下几个参数需要了解:
25
+
26
+ - `color`为线条的颜色
27
+ - `direction`为线条的方向,默认为横向
28
+ - `length`参数需要特别留意,它需要带上单位,比如设置为"50%","500rpx"等,在线条为横向时,表现为线条的长度;在线条为竖向时,表现为线条的高度。
29
+
30
+ ```vue
31
+ <template>
32
+ /* 基础使用 */
33
+ <uv-line></uv-line>
34
+
35
+ /* 自定义颜色 */
36
+ <uv-line color="#2979ff"></uv-line>
37
+
38
+ /* 自定义线条方向 */
39
+ <uv-line direction="col"></uv-line>
40
+
41
+ /* 自定义线条长度 */
42
+ <uv-line length="50%"></uv-line>
43
+ </template>
44
+ ```
45
+
46
+
47
+ ### 是否虚线
48
+
49
+ - `dashed`控制线条是否虚线:
50
+
51
+ ```vue
52
+ <template>
53
+ <uv-line dashed></uv-line>
54
+ </template>
55
+ ```
56
+
57
+ ### 完整示例
58
+
59
+ ::: tip 完整示例下载地址
60
+
61
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
62
+
63
+ :::
64
+
65
+ ### API
66
+ ---
67
+
68
+ ### Line Props
69
+
70
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
71
+ |:- |:- |:- |:- |:- |
72
+ | color | 线条的颜色 | String | #d6d7d9 | - |
73
+ | length | 长度,竖向时表现为高度,横向时表现为长度。`direction="col"`时必须设置`length`值。 | String &#124; Number | 100% | - |
74
+ | direction | 线条的方向,row - 横向,col - 竖向 | String | row | row &#124; col |
75
+ | hairline | 是否显示细边框 | Boolean | true | true &#124; false |
76
+ | margin | 线条与上下左右元素的间距,字符串形式,如"30rpx"、"20rpx 30rpx",默认单位px | String &#124; Number | 0 | - |
77
+ | dashed | 是否虚线 | Boolean | false | true &#124; false |
78
+ | customStyle | 自定义样式 | Object | - | - |
79
+
80
+
81
+ <style scoped>
82
+ h3[id=props] + table thead tr th:nth-child(2){
83
+ width: 37%;
84
+ }
85
+ </style>