uview-pro 0.0.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 (149) hide show
  1. package/changelog.md +6 -0
  2. package/components/u-action-sheet/u-action-sheet.vue +205 -0
  3. package/components/u-alert-tips/u-alert-tips.vue +241 -0
  4. package/components/u-avatar/u-avatar.vue +220 -0
  5. package/components/u-avatar-cropper/u-avatar-cropper.vue +329 -0
  6. package/components/u-avatar-cropper/weCropper.d.ts +54 -0
  7. package/components/u-avatar-cropper/weCropper.js +1267 -0
  8. package/components/u-avatar-cropper/weCropper.ts +1254 -0
  9. package/components/u-back-top/u-back-top.vue +156 -0
  10. package/components/u-badge/u-badge.vue +189 -0
  11. package/components/u-button/u-button.vue +562 -0
  12. package/components/u-calendar/u-calendar.vue +725 -0
  13. package/components/u-car-keyboard/u-car-keyboard.vue +236 -0
  14. package/components/u-card/u-card.vue +240 -0
  15. package/components/u-cell-group/u-cell-group.vue +56 -0
  16. package/components/u-cell-item/u-cell-item.vue +245 -0
  17. package/components/u-checkbox/u-checkbox.vue +310 -0
  18. package/components/u-checkbox-group/u-checkbox-group.vue +134 -0
  19. package/components/u-circle-progress/u-circle-progress.vue +210 -0
  20. package/components/u-col/u-col.vue +135 -0
  21. package/components/u-collapse/u-collapse.vue +82 -0
  22. package/components/u-collapse-item/u-collapse-item.vue +190 -0
  23. package/components/u-column-notice/u-column-notice.vue +264 -0
  24. package/components/u-count-down/u-count-down.vue +333 -0
  25. package/components/u-count-to/u-count-to.vue +297 -0
  26. package/components/u-divider/u-divider.vue +141 -0
  27. package/components/u-dropdown/u-dropdown.vue +311 -0
  28. package/components/u-dropdown-item/u-dropdown-item.vue +135 -0
  29. package/components/u-empty/u-empty.vue +111 -0
  30. package/components/u-field/u-field.vue +469 -0
  31. package/components/u-form/u-form.vue +162 -0
  32. package/components/u-form-item/u-form-item.vue +476 -0
  33. package/components/u-full-screen/u-full-screen.vue +80 -0
  34. package/components/u-gap/u-gap.vue +48 -0
  35. package/components/u-grid/u-grid.vue +101 -0
  36. package/components/u-grid-item/u-grid-item.vue +136 -0
  37. package/components/u-icon/u-icon.vue +389 -0
  38. package/components/u-image/types.ts +48 -0
  39. package/components/u-image/u-image.vue +218 -0
  40. package/components/u-index-anchor/u-index-anchor.vue +101 -0
  41. package/components/u-index-list/u-index-list.vue +376 -0
  42. package/components/u-input/u-input.vue +462 -0
  43. package/components/u-keyboard/u-keyboard.vue +188 -0
  44. package/components/u-lazy-load/u-lazy-load.vue +288 -0
  45. package/components/u-line/u-line.vue +71 -0
  46. package/components/u-line-progress/u-line-progress.vue +128 -0
  47. package/components/u-link/u-link.vue +87 -0
  48. package/components/u-loading/u-loading.vue +111 -0
  49. package/components/u-loadmore/u-loadmore.vue +205 -0
  50. package/components/u-mask/u-mask.vue +137 -0
  51. package/components/u-message-input/u-message-input.vue +315 -0
  52. package/components/u-modal/u-modal.vue +284 -0
  53. package/components/u-navbar/u-navbar.vue +314 -0
  54. package/components/u-no-network/image.ts +2 -0
  55. package/components/u-no-network/u-no-network.vue +311 -0
  56. package/components/u-notice-bar/u-notice-bar.vue +274 -0
  57. package/components/u-number-box/u-number-box.vue +344 -0
  58. package/components/u-number-keyboard/u-number-keyboard.vue +170 -0
  59. package/components/u-parse/libs/CssHandler.js +100 -0
  60. package/components/u-parse/libs/MpHtmlParser.js +580 -0
  61. package/components/u-parse/libs/config.js +80 -0
  62. package/components/u-parse/libs/handler.wxs +22 -0
  63. package/components/u-parse/libs/trees.vue +505 -0
  64. package/components/u-parse/u-parse.vue +645 -0
  65. package/components/u-picker/u-picker.vue +808 -0
  66. package/components/u-popup/u-popup.vue +404 -0
  67. package/components/u-radio/u-radio.vue +272 -0
  68. package/components/u-radio-group/u-radio-group.vue +116 -0
  69. package/components/u-rate/u-rate.vue +349 -0
  70. package/components/u-read-more/u-read-more.vue +199 -0
  71. package/components/u-row/u-row.vue +95 -0
  72. package/components/u-row-notice/u-row-notice.vue +273 -0
  73. package/components/u-search/u-search.vue +298 -0
  74. package/components/u-section/u-section.vue +175 -0
  75. package/components/u-select/u-select.vue +387 -0
  76. package/components/u-skeleton/u-skeleton.vue +230 -0
  77. package/components/u-slider/u-slider.vue +293 -0
  78. package/components/u-steps/u-steps.vue +200 -0
  79. package/components/u-sticky/u-sticky.vue +189 -0
  80. package/components/u-subsection/u-subsection.vue +388 -0
  81. package/components/u-swipe-action/u-swipe-action.vue +289 -0
  82. package/components/u-swiper/u-swiper.vue +305 -0
  83. package/components/u-switch/u-switch.vue +146 -0
  84. package/components/u-tabbar/u-tabbar.vue +347 -0
  85. package/components/u-table/u-table.vue +104 -0
  86. package/components/u-tabs/u-tabs.vue +322 -0
  87. package/components/u-tabs-swiper/u-tabs-swiper.vue +426 -0
  88. package/components/u-tag/u-tag.vue +270 -0
  89. package/components/u-td/u-td.vue +76 -0
  90. package/components/u-th/u-th.vue +70 -0
  91. package/components/u-time-line/u-time-line.vue +39 -0
  92. package/components/u-time-line-item/u-time-line-item.vue +88 -0
  93. package/components/u-toast/types.ts +4 -0
  94. package/components/u-toast/u-toast.vue +238 -0
  95. package/components/u-top-tips/u-top-tips.vue +118 -0
  96. package/components/u-tr/u-tr.vue +24 -0
  97. package/components/u-upload/u-upload.vue +600 -0
  98. package/components/u-verification-code/u-verification-code.vue +194 -0
  99. package/components/u-waterfall/u-waterfall.vue +186 -0
  100. package/iconfont.css +910 -0
  101. package/index.scss +23 -0
  102. package/index.ts +166 -0
  103. package/libs/config/config.ts +26 -0
  104. package/libs/config/zIndex.ts +37 -0
  105. package/libs/css/color.scss +155 -0
  106. package/libs/css/common.scss +176 -0
  107. package/libs/css/style.components.scss +7 -0
  108. package/libs/css/style.h5.scss +8 -0
  109. package/libs/css/style.mp.scss +72 -0
  110. package/libs/css/style.nvue.scss +3 -0
  111. package/libs/css/style.vue.scss +175 -0
  112. package/libs/function/$parent.ts +22 -0
  113. package/libs/function/addUnit.ts +13 -0
  114. package/libs/function/color.ts +37 -0
  115. package/libs/function/colorGradient.ts +123 -0
  116. package/libs/function/debounce.ts +28 -0
  117. package/libs/function/deepClone.ts +39 -0
  118. package/libs/function/deepMerge.ts +34 -0
  119. package/libs/function/getParent.ts +59 -0
  120. package/libs/function/getRect.ts +26 -0
  121. package/libs/function/guid.ts +42 -0
  122. package/libs/function/md5.ts +397 -0
  123. package/libs/function/parent.ts +21 -0
  124. package/libs/function/queryParams.ts +60 -0
  125. package/libs/function/random.ts +16 -0
  126. package/libs/function/randomArray.ts +11 -0
  127. package/libs/function/route.ts +118 -0
  128. package/libs/function/sys.ts +15 -0
  129. package/libs/function/test.ts +229 -0
  130. package/libs/function/throttle.ts +31 -0
  131. package/libs/function/timeFormat.ts +54 -0
  132. package/libs/function/timeFrom.ts +48 -0
  133. package/libs/function/toast.ts +14 -0
  134. package/libs/function/trim.ts +21 -0
  135. package/libs/function/type2icon.ts +36 -0
  136. package/libs/hooks/useEmitter.ts +77 -0
  137. package/libs/hooks/useParent.ts +29 -0
  138. package/libs/request/index.ts +237 -0
  139. package/libs/store/index.ts +88 -0
  140. package/libs/util/area.ts +1 -0
  141. package/libs/util/async-validator.js +1356 -0
  142. package/libs/util/city.ts +1 -0
  143. package/libs/util/emitter.ts +112 -0
  144. package/libs/util/mitt.ts +118 -0
  145. package/libs/util/parent.ts +20 -0
  146. package/libs/util/province.ts +1 -0
  147. package/package.json +98 -0
  148. package/readme.md +165 -0
  149. package/theme.scss +38 -0
package/index.scss ADDED
@@ -0,0 +1,23 @@
1
+ // 引入公共基础类
2
+ @import "./libs/css/common.scss";
3
+ @import "./libs/css/color.scss";
4
+
5
+ // 非nvue的样式
6
+ /* #ifndef APP-NVUE */
7
+ @import "./libs/css/style.vue.scss";
8
+ /* #endif */
9
+
10
+ // nvue的特有样式
11
+ /* #ifdef APP-NVUE */
12
+ @import "./libs/css/style.nvue.scss";
13
+ /* #endif */
14
+
15
+ // 小程序特有的样式
16
+ /* #ifdef MP */
17
+ @import "./libs/css/style.mp.scss";
18
+ /* #endif */
19
+
20
+ // H5特有的样式
21
+ /* #ifdef H5 */
22
+ @import "./libs/css/style.h5.scss";
23
+ /* #endif */
package/index.ts ADDED
@@ -0,0 +1,166 @@
1
+ // 全局挂载引入http相关请求拦截插件
2
+ import http from './libs/request/index';
3
+ // post类型对象参数转为get类型url参数
4
+ import queryParams from './libs/function/queryParams';
5
+ // 路由封装
6
+ import route from './libs/function/route';
7
+ // 时间格式化
8
+ import timeFormat from './libs/function/timeFormat';
9
+ // 时间戳格式化,返回多久之前
10
+ import timeFrom from './libs/function/timeFrom';
11
+ // 颜色渐变相关,colorGradient-颜色渐变,hexToRgb-十六进制颜色转rgb颜色,rgbToHex-rgb转十六进制
12
+ import colorGradient from './libs/function/colorGradient';
13
+ // 生成全局唯一guid字符串
14
+ import guid from './libs/function/guid';
15
+ // 主题相关颜色,info|success|warning|primary|default|error,此颜色已在uview.scss中定义,但是为js中也能使用,故也定义一份
16
+ import color from './libs/function/color';
17
+ // 根据type获取图标名称
18
+ import type2icon from './libs/function/type2icon';
19
+ // 打乱数组的顺序
20
+ import randomArray from './libs/function/randomArray';
21
+ // 对象和数组的深度克隆
22
+ import deepClone from './libs/function/deepClone';
23
+ // 对象深度拷贝
24
+ import deepMerge from './libs/function/deepMerge';
25
+ // 添加单位
26
+ import addUnit from './libs/function/addUnit';
27
+ // 规则检验
28
+ import test from './libs/function/test';
29
+ // 随机数
30
+ import random from './libs/function/random';
31
+ // 去除空格
32
+ import trim from './libs/function/trim';
33
+ // toast提示,对uni.showToast的封装
34
+ import toast from './libs/function/toast';
35
+ // 获取父组件参数
36
+ import getParent from './libs/function/getParent';
37
+ // 获取整个父组件
38
+ import $parent from './libs/function/$parent';
39
+ // 获取sys()和os()工具方法
40
+ // 获取设备信息,挂载到$u的sys()(system的缩写)属性中,
41
+ // 同时把安卓和ios平台的名称"ios"和"android"挂到$u.os()中,方便取用
42
+ import { sys, os } from './libs/function/sys';
43
+ // 防抖方法
44
+ import debounce from './libs/function/debounce';
45
+ // 节流方法
46
+ import throttle from './libs/function/throttle';
47
+ // 获取元素的位置信息
48
+ import getRect from './libs/function/getRect';
49
+ // 获取父组件
50
+ import { parentData, parent } from './libs/function/parent';
51
+
52
+ // 配置信息
53
+ import config from './libs/config/config';
54
+ // 各个需要fixed的地方的z-index配置文件
55
+ import zIndex from './libs/config/zIndex';
56
+ import { dispatch, broadcast } from './libs/util/emitter';
57
+ import { mitt } from './libs/util/mitt';
58
+ import { type RequestOptions } from './libs/request/index';
59
+
60
+ declare const uni: {
61
+ [key: string]: any;
62
+ $u?: typeof $u;
63
+ createSelectorQuery: () => any;
64
+ hideLoading: () => void;
65
+ showLoading: (options: any) => void;
66
+ request: (options: RequestOptions) => any;
67
+ };
68
+
69
+ /**
70
+ * $u 工具库类型声明
71
+ */
72
+ export interface UViewUtils {
73
+ queryParams: typeof queryParams;
74
+ route: typeof route;
75
+ timeFormat: typeof timeFormat;
76
+ date: typeof timeFormat;
77
+ timeFrom: typeof timeFrom;
78
+ colorGradient: typeof colorGradient.colorGradient;
79
+ colorToRgba: typeof colorGradient.colorToRgba;
80
+ guid: typeof guid;
81
+ color: typeof color;
82
+ sys: typeof sys;
83
+ os: typeof os;
84
+ type2icon: typeof type2icon;
85
+ randomArray: typeof randomArray;
86
+ dispatch: typeof dispatch;
87
+ broadcast: typeof broadcast;
88
+ get: typeof http.get;
89
+ post: typeof http.post;
90
+ put: typeof http.put;
91
+ delete: typeof http.delete;
92
+ hexToRgb: typeof colorGradient.hexToRgb;
93
+ rgbToHex: typeof colorGradient.rgbToHex;
94
+ test: typeof test;
95
+ random: typeof random;
96
+ deepClone: typeof deepClone;
97
+ deepMerge: typeof deepMerge;
98
+ getParent: typeof getParent;
99
+ $parent: typeof $parent;
100
+ parent: typeof parent;
101
+ parentData: typeof parentData;
102
+ addUnit: typeof addUnit;
103
+ trim: typeof trim;
104
+ type: string[];
105
+ http: typeof http;
106
+ toast: typeof toast;
107
+ config: typeof config;
108
+ zIndex: typeof zIndex;
109
+ debounce: typeof debounce;
110
+ throttle: typeof throttle;
111
+ mitt: ReturnType<typeof mitt>;
112
+ getRect: typeof getRect;
113
+ }
114
+
115
+ export const $u: UViewUtils = {
116
+ queryParams: queryParams,
117
+ route: route,
118
+ timeFormat: timeFormat,
119
+ date: timeFormat, // 另名date
120
+ timeFrom,
121
+ colorGradient: colorGradient.colorGradient,
122
+ colorToRgba: colorGradient.colorToRgba,
123
+ guid,
124
+ color,
125
+ sys,
126
+ os,
127
+ type2icon,
128
+ randomArray,
129
+ dispatch,
130
+ broadcast,
131
+ get: http.get,
132
+ post: http.post,
133
+ put: http.put,
134
+ delete: http.delete,
135
+ hexToRgb: colorGradient.hexToRgb,
136
+ rgbToHex: colorGradient.rgbToHex,
137
+ test,
138
+ random,
139
+ deepClone,
140
+ deepMerge,
141
+ getParent,
142
+ $parent,
143
+ parent,
144
+ parentData,
145
+ addUnit,
146
+ trim,
147
+ type: ['primary', 'success', 'error', 'warning', 'info'],
148
+ http,
149
+ toast,
150
+ config, // uView配置信息相关,比如版本号
151
+ zIndex,
152
+ debounce,
153
+ throttle,
154
+ mitt: mitt(),
155
+ getRect
156
+ };
157
+
158
+ // $u挂载到uni对象上
159
+
160
+ const install = (): void => {
161
+ uni.$u = $u;
162
+ };
163
+
164
+ export default {
165
+ install
166
+ };
@@ -0,0 +1,26 @@
1
+ // 此版本发布于2023-03-27
2
+ /**
3
+ * 组件库配置项类型定义
4
+ */
5
+
6
+ import { version } from '../../package.json';
7
+
8
+ export interface AppConfig {
9
+ /** 版本号 */
10
+ v: string;
11
+ /** 版本号(冗余字段) */
12
+ version: string;
13
+ /** 主题名称列表 */
14
+ type: string[];
15
+ }
16
+
17
+ // const version: string = '1.8.8';
18
+
19
+ const config: AppConfig = {
20
+ v: version,
21
+ version: version,
22
+ // 主题名称
23
+ type: ['primary', 'success', 'info', 'error', 'warning']
24
+ };
25
+
26
+ export default config;
@@ -0,0 +1,37 @@
1
+ // uniapp在H5中各API的z-index值如下:
2
+ /**
3
+ * actionsheet: 999
4
+ * modal: 999
5
+ * navigate: 998
6
+ * tabbar: 998
7
+ * toast: 999
8
+ */
9
+
10
+ /**
11
+ * 组件库 z-index 配置项类型定义
12
+ */
13
+ export interface ZIndexConfig {
14
+ toast: number;
15
+ noNetwork: number;
16
+ /** popup包含popup,actionsheet,keyboard,picker的值 */
17
+ popup: number;
18
+ mask: number;
19
+ navbar: number;
20
+ topTips: number;
21
+ sticky: number;
22
+ indexListSticky: number;
23
+ }
24
+
25
+ const zIndex: ZIndexConfig = {
26
+ toast: 10090,
27
+ noNetwork: 10080,
28
+ // popup包含popup,actionsheet,keyboard,picker的值
29
+ popup: 10075,
30
+ mask: 10070,
31
+ navbar: 980,
32
+ topTips: 975,
33
+ sticky: 970,
34
+ indexListSticky: 965
35
+ };
36
+
37
+ export default zIndex;
@@ -0,0 +1,155 @@
1
+ .u-type-primary-light {
2
+ color: $u-type-primary-light;
3
+ }
4
+
5
+ .u-type-warning-light {
6
+ color: $u-type-warning-light;
7
+ }
8
+
9
+ .u-type-success-light {
10
+ color: $u-type-success-light;
11
+ }
12
+
13
+ .u-type-error-light {
14
+ color: $u-type-error-light;
15
+ }
16
+
17
+ .u-type-info-light {
18
+ color: $u-type-info-light;
19
+ }
20
+
21
+ .u-type-primary-light-bg {
22
+ background-color: $u-type-primary-light;
23
+ }
24
+
25
+ .u-type-warning-light-bg {
26
+ background-color: $u-type-warning-light;
27
+ }
28
+
29
+ .u-type-success-light-bg {
30
+ background-color: $u-type-success-light;
31
+ }
32
+
33
+ .u-type-error-light-bg {
34
+ background-color: $u-type-error-light;
35
+ }
36
+
37
+ .u-type-info-light-bg {
38
+ background-color: $u-type-info-light;
39
+ }
40
+
41
+ .u-type-primary-dark {
42
+ color: $u-type-primary-dark;
43
+ }
44
+
45
+ .u-type-warning-dark {
46
+ color: $u-type-warning-dark;
47
+ }
48
+
49
+ .u-type-success-dark {
50
+ color: $u-type-success-dark;
51
+ }
52
+
53
+ .u-type-error-dark {
54
+ color: $u-type-error-dark;
55
+ }
56
+
57
+ .u-type-info-dark {
58
+ color: $u-type-info-dark;
59
+ }
60
+
61
+ .u-type-primary-dark-bg {
62
+ background-color: $u-type-primary-dark;
63
+ }
64
+
65
+ .u-type-warning-dark-bg {
66
+ background-color: $u-type-warning-dark;
67
+ }
68
+
69
+ .u-type-success-dark-bg {
70
+ background-color: $u-type-success-dark;
71
+ }
72
+
73
+ .u-type-error-dark-bg {
74
+ background-color: $u-type-error-dark;
75
+ }
76
+
77
+ .u-type-info-dark-bg {
78
+ background-color: $u-type-info-dark;
79
+ }
80
+
81
+ .u-type-primary-disabled {
82
+ color: $u-type-primary-disabled;
83
+ }
84
+
85
+ .u-type-warning-disabled {
86
+ color: $u-type-warning-disabled;
87
+ }
88
+
89
+ .u-type-success-disabled {
90
+ color: $u-type-success-disabled;
91
+ }
92
+
93
+ .u-type-error-disabled {
94
+ color: $u-type-error-disabled;
95
+ }
96
+
97
+ .u-type-info-disabled {
98
+ color: $u-type-info-disabled;
99
+ }
100
+
101
+ .u-type-primary {
102
+ color: $u-type-primary;
103
+ }
104
+
105
+ .u-type-warning {
106
+ color: $u-type-warning;
107
+ }
108
+
109
+ .u-type-success {
110
+ color: $u-type-success;
111
+ }
112
+
113
+ .u-type-error {
114
+ color: $u-type-error;
115
+ }
116
+
117
+ .u-type-info {
118
+ color: $u-type-info;
119
+ }
120
+
121
+ .u-type-primary-bg {
122
+ background-color: $u-type-primary;
123
+ }
124
+
125
+ .u-type-warning-bg {
126
+ background-color: $u-type-warning;
127
+ }
128
+
129
+ .u-type-success-bg {
130
+ background-color: $u-type-success;
131
+ }
132
+
133
+ .u-type-error-bg {
134
+ background-color: $u-type-error;
135
+ }
136
+
137
+ .u-type-info-bg {
138
+ background-color: $u-type-info;
139
+ }
140
+
141
+ .u-main-color {
142
+ color: $u-main-color;
143
+ }
144
+
145
+ .u-content-color {
146
+ color: $u-content-color;
147
+ }
148
+
149
+ .u-tips-color {
150
+ color: $u-tips-color;
151
+ }
152
+
153
+ .u-light-color {
154
+ color: $u-light-color;
155
+ }
@@ -0,0 +1,176 @@
1
+ .u-relative,
2
+ .u-rela {
3
+ position: relative;
4
+ }
5
+
6
+ .u-absolute,
7
+ .u-abso {
8
+ position: absolute;
9
+ }
10
+
11
+ // nvue不能用标签命名样式,不能放在微信组件中,否则微信开发工具会报警告,无法使用标签名当做选择器
12
+ /* #ifndef APP-NVUE */
13
+ image {
14
+ display: inline-block;
15
+ }
16
+
17
+ // 在weex,也即nvue中,所有元素默认为border-box
18
+ view,
19
+ text {
20
+ box-sizing: border-box;
21
+ }
22
+ /* #endif */
23
+
24
+ .u-font-xs {
25
+ font-size: 22rpx;
26
+ }
27
+
28
+ .u-font-sm {
29
+ font-size: 26rpx;
30
+ }
31
+
32
+ .u-font-md {
33
+ font-size: 28rpx;
34
+ }
35
+
36
+ .u-font-lg {
37
+ font-size: 30rpx;
38
+ }
39
+
40
+ .u-font-xl {
41
+ font-size: 34rpx;
42
+ }
43
+
44
+ .u-flex {
45
+ /* #ifndef APP-NVUE */
46
+ display: flex;
47
+ /* #endif */
48
+ flex-direction: row;
49
+ align-items: center;
50
+ }
51
+
52
+ .u-flex-wrap {
53
+ flex-wrap: wrap;
54
+ }
55
+
56
+ .u-flex-nowrap {
57
+ flex-wrap: nowrap;
58
+ }
59
+
60
+ .u-col-center {
61
+ align-items: center;
62
+ }
63
+
64
+ .u-col-top {
65
+ align-items: flex-start;
66
+ }
67
+
68
+ .u-col-bottom {
69
+ align-items: flex-end;
70
+ }
71
+
72
+ .u-row-center {
73
+ justify-content: center;
74
+ }
75
+
76
+ .u-row-left {
77
+ justify-content: flex-start;
78
+ }
79
+
80
+ .u-row-right {
81
+ justify-content: flex-end;
82
+ }
83
+
84
+ .u-row-between {
85
+ justify-content: space-between;
86
+ }
87
+
88
+ .u-row-around {
89
+ justify-content: space-around;
90
+ }
91
+
92
+ .u-text-left {
93
+ text-align: left;
94
+ }
95
+
96
+ .u-text-center {
97
+ text-align: center;
98
+ }
99
+
100
+ .u-text-right {
101
+ text-align: right;
102
+ }
103
+
104
+ .u-flex-col {
105
+ /* #ifndef APP-NVUE */
106
+ display: flex;
107
+ /* #endif */
108
+ flex-direction: column;
109
+ }
110
+
111
+ // 定义flex等分
112
+ @for $i from 0 through 12 {
113
+ .u-flex-#{$i} {
114
+ flex: $i;
115
+ }
116
+ }
117
+
118
+ // 定义字体(px)单位,小于20都为px单位字体
119
+ @for $i from 9 to 20 {
120
+ .u-font-#{$i} {
121
+ font-size: $i + px;
122
+ }
123
+ }
124
+
125
+ // 定义字体(rpx)单位,大于或等于20的都为rpx单位字体
126
+ @for $i from 20 through 40 {
127
+ .u-font-#{$i} {
128
+ font-size: $i + rpx;
129
+ }
130
+ }
131
+
132
+ // 定义内外边距,历遍1-80
133
+ @for $i from 0 through 80 {
134
+ // 只要双数和能被5除尽的数
135
+ @if $i % 2 == 0 or $i % 5 == 0 {
136
+ // 得出:u-margin-30或者u-m-30
137
+ .u-margin-#{$i}, .u-m-#{$i} {
138
+ margin: $i + rpx!important;
139
+ }
140
+
141
+ // 得出:u-padding-30或者u-p-30
142
+ .u-padding-#{$i}, .u-p-#{$i} {
143
+ padding: $i + rpx!important;
144
+ }
145
+
146
+ @each $short, $long in l left, t top, r right, b bottom {
147
+ // 缩写版,结果如: u-m-l-30
148
+ // 定义外边距
149
+ .u-m-#{$short}-#{$i} {
150
+ margin-#{$long}: $i + rpx!important;
151
+ }
152
+
153
+ // 定义内边距
154
+ .u-p-#{$short}-#{$i} {
155
+ padding-#{$long}: $i + rpx!important;
156
+ }
157
+
158
+ // 完整版,结果如:u-margin-left-30
159
+ // 定义外边距
160
+ .u-margin-#{$long}-#{$i} {
161
+ margin-#{$long}: $i + rpx!important;
162
+ }
163
+
164
+ // 定义内边距
165
+ .u-padding-#{$long}-#{$i} {
166
+ padding-#{$long}: $i + rpx!important;
167
+ }
168
+ }
169
+ }
170
+ }
171
+
172
+ // 重置nvue的默认关于flex的样式
173
+ .u-reset-nvue {
174
+ flex-direction: row;
175
+ align-items: center;
176
+ }
@@ -0,0 +1,7 @@
1
+ // 定义混入指令,用于在非nvue环境下的flex定义,因为nvue没有display属性,会报错
2
+ @mixin vue-flex($direction: row) {
3
+ /* #ifndef APP-NVUE */
4
+ display: flex;
5
+ flex-direction: $direction;
6
+ /* #endif */
7
+ }
@@ -0,0 +1,8 @@
1
+ /* H5的时候,隐藏滚动条 */
2
+ ::-webkit-scrollbar {
3
+ display: none;
4
+ width: 0 !important;
5
+ height: 0 !important;
6
+ -webkit-appearance: none;
7
+ background: transparent;
8
+ }
@@ -0,0 +1,72 @@
1
+ /* start--微信小程序编译后页面有组件名的元素,特别处理--start */
2
+ /* #ifdef MP-WEIXIN || MP-QQ */
3
+ u-td, u-th {
4
+ flex: 1;
5
+ align-self: stretch;
6
+ }
7
+
8
+ .u-td {
9
+ height: 100%;
10
+ }
11
+
12
+ u-icon {
13
+ display: inline-flex;
14
+ align-items: center;
15
+ }
16
+
17
+ // 各家小程序宫格组件外层设置为100%,避免受到父元素display: flex;的影响
18
+ u-grid {
19
+ width: 100%;
20
+ flex: 0 0 100%;
21
+ }
22
+
23
+ // 避免小程序线条组件因为父组件display: flex;而失效
24
+ u-line {
25
+ flex: 1;
26
+ }
27
+
28
+ u-switch {
29
+ display: inline-flex;
30
+ align-items: center;
31
+ }
32
+
33
+ u-dropdown {
34
+ flex: 1;
35
+ }
36
+ /* #endif */
37
+ /* end-微信小程序编译后页面有组件名的元素,特别处理--end */
38
+
39
+
40
+ /* #ifdef MP-QQ || MP-TOUTIAO */
41
+ // 需要做这一切额外的兼容,都是因为TX的无能
42
+ u-icon {
43
+ line-height: 0;
44
+ }
45
+ /* #endif */
46
+
47
+ /* start--头条小程序编译后页面有组件名的元素,特别处理--start */
48
+ // 由于头条小程序不支持直接组件名形式写样式,目前只能在写组件的时候给组件加上对应的类名
49
+ /* #ifdef MP-TOUTIAO */
50
+ .u-td, .u-th, .u-tr {
51
+ flex: 1;
52
+ align-self: stretch;
53
+ }
54
+
55
+ .u-row, .u-col {
56
+ flex: 1;
57
+ align-self: stretch;
58
+ }
59
+
60
+ // 避免小程序线条组件因为父组件display: flex;而失效
61
+ .u-line {
62
+ flex: 1;
63
+ }
64
+
65
+ .u-dropdown {
66
+ flex: 1;
67
+ }
68
+ /* #endif */
69
+ /* end-头条小程序编译后页面有组件名的元素,特别处理--end */
70
+
71
+
72
+
@@ -0,0 +1,3 @@
1
+ .nvue {
2
+ font-size: 24rpx;
3
+ }