@kengic/uni 0.5.1 → 0.5.2-beta.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.
- package/dist/uni/uni-ui/uni-badge/uni-badge.vue +222 -219
- package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +29 -29
- package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +88 -88
- package/dist/uni/uni-ui/uni-calendar/calendar.js +936 -532
- package/dist/uni/uni-ui/uni-calendar/i18n/en.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hans.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hant.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/uni-calendar-item.vue +190 -168
- package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +459 -459
- package/dist/uni/uni-ui/uni-calendar/util.js +324 -340
- package/dist/uni/uni-ui/uni-card/uni-card.vue +8 -1
- package/dist/uni/uni-ui/uni-col/uni-col.vue +294 -287
- package/dist/uni/uni-ui/uni-collapse/uni-collapse.vue +139 -140
- package/dist/uni/uni-ui/uni-collapse-item/uni-collapse-item.vue +381 -378
- package/dist/uni/uni-ui/uni-combox/uni-combox.vue +280 -272
- package/dist/uni/uni-ui/uni-countdown/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/uni-countdown.vue +249 -257
- package/dist/uni/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +832 -813
- package/dist/uni/uni-ui/uni-data-picker/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-data-picker/uni-data-picker.vue +535 -516
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-picker.js +623 -618
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +293 -288
- package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +495 -509
- package/dist/uni/uni-ui/uni-dateformat/date-format.js +181 -184
- package/dist/uni/uni-ui/uni-dateformat/uni-dateformat.vue +81 -82
- package/dist/uni/uni-ui/uni-datetime-picker/calendar-item.vue +176 -170
- package/dist/uni/uni-ui/uni-datetime-picker/calendar.vue +926 -920
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/en.json +20 -20
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/time-picker.vue +921 -926
- package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1059 -1012
- package/dist/uni/uni-ui/uni-datetime-picker/util.js +366 -377
- package/dist/uni/uni-ui/uni-drawer/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-drawer/uni-drawer.vue +176 -167
- package/dist/uni/uni-ui/uni-easyinput/common.js +40 -42
- package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +628 -547
- package/dist/uni/uni-ui/uni-fab/uni-fab.vue +507 -483
- package/dist/uni/uni-ui/uni-fav/i18n/en.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-fav/uni-fav.vue +155 -147
- package/dist/uni/uni-ui/uni-file-picker/choose-and-upload-file.js +172 -198
- package/dist/uni/uni-ui/uni-file-picker/uni-file-picker.vue +636 -634
- package/dist/uni/uni-ui/uni-file-picker/upload-file.vue +294 -293
- package/dist/uni/uni-ui/uni-file-picker/upload-image.vue +267 -270
- package/dist/uni/uni-ui/uni-file-picker/utils.js +81 -82
- package/dist/uni/uni-ui/uni-forms/uni-forms.vue +360 -372
- package/dist/uni/uni-ui/uni-forms/utils.js +170 -174
- package/dist/uni/uni-ui/uni-forms/validate.js +447 -456
- package/dist/uni/uni-ui/uni-forms-item/uni-forms-item.vue +497 -497
- package/dist/uni/uni-ui/uni-goods-nav/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/uni-goods-nav.vue +238 -222
- package/dist/uni/uni-ui/uni-grid/uni-grid.vue +134 -134
- package/dist/uni/uni-ui/uni-grid-item/uni-grid-item.vue +121 -119
- package/dist/uni/uni-ui/uni-group/uni-group.vue +121 -121
- package/dist/uni/uni-ui/uni-icons/icons.js +1170 -1168
- package/dist/uni/uni-ui/uni-icons/uni-icons.vue +91 -86
- package/dist/uni/uni-ui/uni-icons/uniicons.css +166 -166
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +129 -129
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list.vue +352 -347
- package/dist/uni/uni-ui/uni-link/uni-link.vue +134 -119
- package/dist/uni/uni-ui/uni-list/uni-list.vue +119 -110
- package/dist/uni/uni-ui/uni-list/uni-refresh.vue +14 -14
- package/dist/uni/uni-ui/uni-list/uni-refresh.wxs +14 -14
- package/dist/uni/uni-ui/uni-list-ad/uni-list-ad.vue +101 -95
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.scss +18 -18
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.vue +602 -586
- package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
- package/dist/uni/uni-ui/uni-load-more/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/uni-load-more.vue +402 -392
- package/dist/uni/uni-ui/uni-nav-bar/uni-nav-bar.vue +328 -330
- package/dist/uni/uni-ui/uni-nav-bar/uni-status-bar.vue +17 -17
- package/dist/uni/uni-ui/uni-notice-bar/uni-notice-bar.vue +422 -401
- package/dist/uni/uni-ui/uni-number-box/uni-number-box.vue +211 -205
- package/dist/uni/uni-ui/uni-pagination/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/es.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/fr.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/index.js +12 -11
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +450 -433
- package/dist/uni/uni-ui/uni-popup/uni-popup.vue +404 -404
- package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +1 -0
- package/dist/uni/uni-ui/uni-popup-message/uni-popup-message.vue +126 -125
- package/dist/uni/uni-ui/uni-popup-share/uni-popup-share.vue +172 -172
- package/dist/uni/uni-ui/uni-rate/uni-rate.vue +343 -347
- package/dist/uni/uni-ui/uni-row/uni-row.vue +180 -182
- package/dist/uni/uni-ui/uni-scss/changelog.md +11 -4
- package/dist/uni/uni-ui/uni-scss/package.json +73 -73
- package/dist/uni/uni-ui/uni-scss/readme.md +2 -1
- package/dist/uni/uni-ui/uni-scss/styles/setting/_border.scss +2 -2
- package/dist/uni/uni-ui/uni-scss/styles/setting/_color.scss +46 -47
- package/dist/uni/uni-ui/uni-scss/styles/setting/_radius.scss +49 -49
- package/dist/uni/uni-ui/uni-scss/styles/setting/_space.scss +52 -53
- package/dist/uni/uni-ui/uni-scss/styles/setting/_styles.scss +142 -147
- package/dist/uni/uni-ui/uni-scss/styles/setting/_text.scss +20 -20
- package/dist/uni/uni-ui/uni-scss/styles/setting/_variables.scss +111 -95
- package/dist/uni/uni-ui/uni-scss/styles/tools/functions.scss +28 -18
- package/dist/uni/uni-ui/uni-scss/theme.scss +10 -7
- package/dist/uni/uni-ui/uni-scss/variables.scss +42 -24
- package/dist/uni/uni-ui/uni-search-bar/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-search-bar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/uni-search-bar.vue +290 -281
- package/dist/uni/uni-ui/uni-section/uni-section.vue +149 -146
- package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +141 -131
- package/dist/uni/uni-ui/uni-steps/uni-steps.vue +255 -236
- package/dist/uni/uni-ui/uni-swipe-action/uni-swipe-action.vue +51 -51
- package/dist/uni/uni-ui/uni-swipe-action-item/bindingx.js +276 -282
- package/dist/uni/uni-ui/uni-swipe-action-item/isPC.js +10 -10
- package/dist/uni/uni-ui/uni-swipe-action-item/mpalipay.js +182 -187
- package/dist/uni/uni-ui/uni-swipe-action-item/mpother.js +235 -244
- package/dist/uni/uni-ui/uni-swipe-action-item/mpwxs.js +70 -75
- package/dist/uni/uni-ui/uni-swipe-action-item/render.js +238 -247
- package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +387 -313
- package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +206 -215
- package/dist/uni/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +241 -197
- package/dist/uni/uni-ui/uni-table/uni-table.vue +445 -447
- package/dist/uni/uni-ui/uni-tag/uni-tag.vue +234 -244
- package/dist/uni/uni-ui/uni-tbody/uni-tbody.vue +20 -23
- package/dist/uni/uni-ui/uni-td/uni-td.vue +79 -80
- package/dist/uni/uni-ui/uni-th/filter-dropdown.vue +510 -503
- package/dist/uni/uni-ui/uni-th/uni-th.vue +289 -273
- package/dist/uni/uni-ui/uni-thead/uni-thead.vue +115 -114
- package/dist/uni/uni-ui/uni-title/uni-title.vue +151 -154
- package/dist/uni/uni-ui/uni-tooltip/uni-tooltip.vue +55 -60
- package/dist/uni/uni-ui/uni-tr/table-checkbox.vue +162 -163
- package/dist/uni/uni-ui/uni-tr/uni-tr.vue +158 -157
- package/dist/uni/uni-ui/uni-transition/createAnimation.js +130 -113
- package/dist/uni/uni-ui/uni-transition/uni-transition.vue +274 -272
- package/package.json +1 -1
|
@@ -147,7 +147,14 @@
|
|
|
147
147
|
margin: $uni-card-spacing;
|
|
148
148
|
border-radius: 4px;
|
|
149
149
|
overflow: hidden;
|
|
150
|
-
font-family:
|
|
150
|
+
font-family:
|
|
151
|
+
Helvetica Neue,
|
|
152
|
+
Helvetica,
|
|
153
|
+
PingFang SC,
|
|
154
|
+
Hiragino Sans GB,
|
|
155
|
+
Microsoft YaHei,
|
|
156
|
+
SimSun,
|
|
157
|
+
sans-serif;
|
|
151
158
|
background-color: #fff;
|
|
152
159
|
flex: 1;
|
|
153
160
|
|
|
@@ -1,317 +1,324 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
<!-- #ifndef APP-NVUE -->
|
|
3
|
+
<view
|
|
4
|
+
:class="['uni-col', sizeClass, pointClassList]"
|
|
5
|
+
:style="{
|
|
6
|
+
paddingLeft: `${Number(gutter)}rpx`,
|
|
7
|
+
paddingRight: `${Number(gutter)}rpx`,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</view>
|
|
12
|
+
<!-- #endif -->
|
|
13
|
+
<!-- #ifdef APP-NVUE -->
|
|
14
|
+
<!-- 在nvue上,类名样式不生效,换为style -->
|
|
15
|
+
<!-- 设置right正值失效,设置 left 负值 -->
|
|
16
|
+
<view
|
|
17
|
+
:class="['uni-col']"
|
|
18
|
+
:style="{
|
|
19
|
+
paddingLeft: `${Number(gutter)}rpx`,
|
|
20
|
+
paddingRight: `${Number(gutter)}rpx`,
|
|
21
|
+
width: `${nvueWidth}rpx`,
|
|
22
|
+
position: 'relative',
|
|
23
|
+
marginLeft: `${marginLeft}rpx`,
|
|
24
|
+
left: `${right === 0 ? left : -right}rpx`,
|
|
25
|
+
}"
|
|
26
|
+
>
|
|
27
|
+
<slot></slot>
|
|
28
|
+
</view>
|
|
29
|
+
<!-- #endif -->
|
|
24
30
|
</template>
|
|
25
31
|
|
|
26
32
|
<script>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Col 布局-列
|
|
35
|
+
* @description 搭配uni-row使用,构建布局。
|
|
36
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=3958
|
|
37
|
+
*
|
|
38
|
+
* @property {span} type = Number 栅格占据的列数
|
|
39
|
+
* 默认 24
|
|
40
|
+
* @property {offset} type = Number 栅格左侧的间隔格数
|
|
41
|
+
* @property {push} type = Number 栅格向右移动格数
|
|
42
|
+
* @property {pull} type = Number 栅格向左移动格数
|
|
43
|
+
* @property {xs} type = [Number, Object] <768px 响应式栅格数或者栅格属性对象
|
|
44
|
+
* @description Number时表示在此屏幕宽度下,栅格占据的列数。Object时可配置多个描述{span: 4, offset: 4}
|
|
45
|
+
* @property {sm} type = [Number, Object] ≥768px 响应式栅格数或者栅格属性对象
|
|
46
|
+
* @description Number时表示在此屏幕宽度下,栅格占据的列数。Object时可配置多个描述{span: 4, offset: 4}
|
|
47
|
+
* @property {md} type = [Number, Object] ≥992px 响应式栅格数或者栅格属性对象
|
|
48
|
+
* @description Number时表示在此屏幕宽度下,栅格占据的列数。Object时可配置多个描述{span: 4, offset: 4}
|
|
49
|
+
* @property {lg} type = [Number, Object] ≥1200px 响应式栅格数或者栅格属性对象
|
|
50
|
+
* @description Number时表示在此屏幕宽度下,栅格占据的列数。Object时可配置多个描述{span: 4, offset: 4}
|
|
51
|
+
* @property {xl} type = [Number, Object] ≥1920px 响应式栅格数或者栅格属性对象
|
|
52
|
+
* @description Number时表示在此屏幕宽度下,栅格占据的列数。Object时可配置多个描述{span: 4, offset: 4}
|
|
53
|
+
*/
|
|
54
|
+
const ComponentClass = 'uni-col';
|
|
49
55
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
56
|
+
// -1 默认值,因为在微信小程序端只给Number会有默认值0
|
|
57
|
+
export default {
|
|
58
|
+
name: 'uniCol',
|
|
59
|
+
// #ifdef MP-WEIXIN
|
|
60
|
+
options: {
|
|
61
|
+
virtualHost: true, // 在微信小程序中将组件节点渲染为虚拟节点,更加接近Vue组件的表现
|
|
62
|
+
},
|
|
63
|
+
// #endif
|
|
64
|
+
props: {
|
|
65
|
+
span: {
|
|
66
|
+
type: Number,
|
|
67
|
+
default: 24,
|
|
68
|
+
},
|
|
69
|
+
offset: {
|
|
70
|
+
type: Number,
|
|
71
|
+
default: -1,
|
|
72
|
+
},
|
|
73
|
+
pull: {
|
|
74
|
+
type: Number,
|
|
75
|
+
default: -1,
|
|
76
|
+
},
|
|
77
|
+
push: {
|
|
78
|
+
type: Number,
|
|
79
|
+
default: -1,
|
|
80
|
+
},
|
|
81
|
+
xs: [Number, Object],
|
|
82
|
+
sm: [Number, Object],
|
|
83
|
+
md: [Number, Object],
|
|
84
|
+
lg: [Number, Object],
|
|
85
|
+
xl: [Number, Object],
|
|
86
|
+
},
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
gutter: 0,
|
|
90
|
+
sizeClass: '',
|
|
91
|
+
parentWidth: 0,
|
|
92
|
+
nvueWidth: 0,
|
|
93
|
+
marginLeft: 0,
|
|
94
|
+
right: 0,
|
|
95
|
+
left: 0,
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
created() {
|
|
99
|
+
// 字节小程序中,在computed中读取$parent为undefined
|
|
100
|
+
let parent = this.$parent;
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
while (parent && parent.$options.componentName !== 'UniRow') {
|
|
103
|
+
parent = parent.$parent;
|
|
104
|
+
}
|
|
99
105
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
this.updateGutter(parent.gutter);
|
|
107
|
+
parent.$watch('gutter', (gutter) => {
|
|
108
|
+
this.updateGutter(gutter);
|
|
109
|
+
});
|
|
104
110
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
span,
|
|
116
|
-
offset,
|
|
117
|
-
pull,
|
|
118
|
-
push
|
|
119
|
-
} = this;
|
|
111
|
+
// #ifdef APP-NVUE
|
|
112
|
+
this.updateNvueWidth(parent.width);
|
|
113
|
+
parent.$watch('width', (width) => {
|
|
114
|
+
this.updateNvueWidth(width);
|
|
115
|
+
});
|
|
116
|
+
// #endif
|
|
117
|
+
},
|
|
118
|
+
computed: {
|
|
119
|
+
sizeList() {
|
|
120
|
+
let { span, offset, pull, push } = this;
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
return {
|
|
123
|
+
span,
|
|
124
|
+
offset,
|
|
125
|
+
pull,
|
|
126
|
+
push,
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
// #ifndef APP-NVUE
|
|
130
|
+
pointClassList() {
|
|
131
|
+
let classList = [];
|
|
131
132
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
133
|
+
['xs', 'sm', 'md', 'lg', 'xl'].forEach((point) => {
|
|
134
|
+
const props = this[point];
|
|
135
|
+
if (typeof props === 'number') {
|
|
136
|
+
classList.push(`${ComponentClass}-${point}-${props}`);
|
|
137
|
+
} else if (typeof props === 'object' && props) {
|
|
138
|
+
Object.keys(props).forEach((pointProp) => {
|
|
139
|
+
classList.push(
|
|
140
|
+
pointProp === 'span'
|
|
141
|
+
? `${ComponentClass}-${point}-${props[pointProp]}`
|
|
142
|
+
: `${ComponentClass}-${point}-${pointProp}-${props[pointProp]}`,
|
|
143
|
+
);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
});
|
|
146
147
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
148
|
+
// 支付宝小程序使用 :class=[ ['a','b'] ],渲染错误
|
|
149
|
+
return classList.join(' ');
|
|
150
|
+
},
|
|
151
|
+
// #endif
|
|
152
|
+
},
|
|
153
|
+
methods: {
|
|
154
|
+
updateGutter(parentGutter) {
|
|
155
|
+
parentGutter = Number(parentGutter);
|
|
156
|
+
if (!isNaN(parentGutter)) {
|
|
157
|
+
this.gutter = parentGutter / 2;
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
// #ifdef APP-NVUE
|
|
161
|
+
updateNvueWidth(width) {
|
|
162
|
+
// 用于在nvue端,span,offset,pull,push的计算
|
|
163
|
+
this.parentWidth = width;
|
|
164
|
+
['span', 'offset', 'pull', 'push'].forEach((size) => {
|
|
165
|
+
const curSize = this[size];
|
|
166
|
+
if ((curSize || curSize === 0) && curSize !== -1) {
|
|
167
|
+
let RPX = (1 / 24) * curSize * width;
|
|
168
|
+
RPX = Number(RPX);
|
|
169
|
+
switch (size) {
|
|
170
|
+
case 'span':
|
|
171
|
+
this.nvueWidth = RPX;
|
|
172
|
+
break;
|
|
173
|
+
case 'offset':
|
|
174
|
+
this.marginLeft = RPX;
|
|
175
|
+
break;
|
|
176
|
+
case 'pull':
|
|
177
|
+
this.right = RPX;
|
|
178
|
+
break;
|
|
179
|
+
case 'push':
|
|
180
|
+
this.left = RPX;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
// #endif
|
|
187
|
+
},
|
|
188
|
+
watch: {
|
|
189
|
+
sizeList: {
|
|
190
|
+
immediate: true,
|
|
191
|
+
handler(newVal) {
|
|
192
|
+
// #ifndef APP-NVUE
|
|
193
|
+
let classList = [];
|
|
194
|
+
for (let size in newVal) {
|
|
195
|
+
const curSize = newVal[size];
|
|
196
|
+
if ((curSize || curSize === 0) && curSize !== -1) {
|
|
197
|
+
classList.push(size === 'span' ? `${ComponentClass}-${curSize}` : `${ComponentClass}-${size}-${curSize}`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// 支付宝小程序使用 :class=[ ['a','b'] ],渲染错误
|
|
201
|
+
this.sizeClass = classList.join(' ');
|
|
202
|
+
// #endif
|
|
203
|
+
// #ifdef APP-NVUE
|
|
204
|
+
this.updateNvueWidth(this.parentWidth);
|
|
205
|
+
// #endif
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
};
|
|
213
210
|
</script>
|
|
214
211
|
|
|
215
|
-
<style lang=
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
212
|
+
<style lang="scss">
|
|
213
|
+
/* breakpoints */
|
|
214
|
+
$--sm: 768px !default;
|
|
215
|
+
$--md: 992px !default;
|
|
216
|
+
$--lg: 1200px !default;
|
|
217
|
+
$--xl: 1920px !default;
|
|
221
218
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
219
|
+
$breakpoints: (
|
|
220
|
+
'xs': (
|
|
221
|
+
max-width: $--sm - 1,
|
|
222
|
+
),
|
|
223
|
+
'sm': (
|
|
224
|
+
min-width: $--sm,
|
|
225
|
+
),
|
|
226
|
+
'md': (
|
|
227
|
+
min-width: $--md,
|
|
228
|
+
),
|
|
229
|
+
'lg': (
|
|
230
|
+
min-width: $--lg,
|
|
231
|
+
),
|
|
232
|
+
'xl': (
|
|
233
|
+
min-width: $--xl,
|
|
234
|
+
),
|
|
235
|
+
);
|
|
227
236
|
|
|
228
|
-
|
|
229
|
-
|
|
237
|
+
$layout-namespace: '.uni-';
|
|
238
|
+
$col: $layout-namespace + 'col';
|
|
230
239
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
240
|
+
@function getSize($size) {
|
|
241
|
+
/* TODO 1/24 * $size * 100 * 1%; 使用计算后的值,为了解决 vue3 控制台报错 */
|
|
242
|
+
@return 0.04166666666 * $size * 100 * 1%;
|
|
243
|
+
}
|
|
235
244
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
245
|
+
@mixin res($key, $map: $breakpoints) {
|
|
246
|
+
@if map-has-key($map, $key) {
|
|
247
|
+
@media screen and #{inspect(map-get($map,$key))} {
|
|
248
|
+
@content;
|
|
249
|
+
}
|
|
250
|
+
} @else {
|
|
251
|
+
@warn "Undeinfed point: `#{$key}`";
|
|
252
|
+
}
|
|
253
|
+
}
|
|
242
254
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
255
|
+
/* #ifndef APP-NVUE */
|
|
256
|
+
#{$col} {
|
|
257
|
+
float: left;
|
|
258
|
+
box-sizing: border-box;
|
|
259
|
+
}
|
|
247
260
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
261
|
+
#{$col}-0 {
|
|
262
|
+
/* #ifdef APP-NVUE */
|
|
263
|
+
width: 0;
|
|
264
|
+
height: 0;
|
|
265
|
+
margin-top: 0;
|
|
266
|
+
margin-right: 0;
|
|
267
|
+
margin-bottom: 0;
|
|
268
|
+
margin-left: 0;
|
|
269
|
+
/* #endif */
|
|
270
|
+
/* #ifndef APP-NVUE */
|
|
271
|
+
display: none;
|
|
272
|
+
/* #endif */
|
|
273
|
+
}
|
|
253
274
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
margin-top: 0;
|
|
259
|
-
margin-right: 0;
|
|
260
|
-
margin-bottom: 0;
|
|
261
|
-
margin-left: 0;
|
|
262
|
-
/* #endif */
|
|
263
|
-
/* #ifndef APP-NVUE */
|
|
264
|
-
display: none;
|
|
265
|
-
/* #endif */
|
|
266
|
-
}
|
|
275
|
+
@for $i from 0 through 24 {
|
|
276
|
+
#{$col}-#{$i} {
|
|
277
|
+
width: getSize($i);
|
|
278
|
+
}
|
|
267
279
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
280
|
+
#{$col}-offset-#{$i} {
|
|
281
|
+
margin-left: getSize($i);
|
|
282
|
+
}
|
|
272
283
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
284
|
+
#{$col}-pull-#{$i} {
|
|
285
|
+
position: relative;
|
|
286
|
+
right: getSize($i);
|
|
287
|
+
}
|
|
276
288
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
289
|
+
#{$col}-push-#{$i} {
|
|
290
|
+
position: relative;
|
|
291
|
+
left: getSize($i);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
281
294
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
295
|
+
@each $point in map-keys($breakpoints) {
|
|
296
|
+
@include res($point) {
|
|
297
|
+
#{$col}-#{$point}-0 {
|
|
298
|
+
display: none;
|
|
299
|
+
}
|
|
287
300
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
301
|
+
@for $i from 0 through 24 {
|
|
302
|
+
#{$col}-#{$point}-#{$i} {
|
|
303
|
+
width: getSize($i);
|
|
304
|
+
}
|
|
293
305
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
306
|
+
#{$col}-#{$point}-offset-#{$i} {
|
|
307
|
+
margin-left: getSize($i);
|
|
308
|
+
}
|
|
298
309
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
310
|
+
#{$col}-#{$point}-pull-#{$i} {
|
|
311
|
+
position: relative;
|
|
312
|
+
right: getSize($i);
|
|
313
|
+
}
|
|
302
314
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
315
|
+
#{$col}-#{$point}-push-#{$i} {
|
|
316
|
+
position: relative;
|
|
317
|
+
left: getSize($i);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
307
322
|
|
|
308
|
-
|
|
309
|
-
position: relative;
|
|
310
|
-
left: getSize($i);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/* #endif */
|
|
323
|
+
/* #endif */
|
|
317
324
|
</style>
|