@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
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
// #ifdef H5
|
|
2
2
|
export default {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
3
|
+
name: 'Keypress',
|
|
4
|
+
props: {
|
|
5
|
+
disable: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: false,
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
mounted() {
|
|
11
|
+
const keyNames = {
|
|
12
|
+
esc: ['Esc', 'Escape'],
|
|
13
|
+
tab: 'Tab',
|
|
14
|
+
enter: 'Enter',
|
|
15
|
+
space: [' ', 'Spacebar'],
|
|
16
|
+
up: ['Up', 'ArrowUp'],
|
|
17
|
+
left: ['Left', 'ArrowLeft'],
|
|
18
|
+
right: ['Right', 'ArrowRight'],
|
|
19
|
+
down: ['Down', 'ArrowDown'],
|
|
20
|
+
delete: ['Backspace', 'Delete', 'Del'],
|
|
21
|
+
};
|
|
22
|
+
const listener = ($event) => {
|
|
23
|
+
if (this.disable) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const keyName = Object.keys(keyNames).find((key) => {
|
|
27
|
+
const keyName = $event.key;
|
|
28
|
+
const value = keyNames[key];
|
|
29
|
+
return value === keyName || (Array.isArray(value) && value.includes(keyName));
|
|
30
|
+
});
|
|
31
|
+
if (keyName) {
|
|
32
|
+
// 避免和其他按键事件冲突
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
this.$emit(keyName, {});
|
|
35
|
+
}, 0);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
document.addEventListener('keyup', listener);
|
|
39
|
+
// this.$once('hook:beforeDestroy', () => {
|
|
40
|
+
// document.removeEventListener('keyup', listener)
|
|
41
|
+
// })
|
|
42
|
+
},
|
|
43
|
+
render: () => {},
|
|
44
|
+
};
|
|
45
45
|
// #endif
|
|
@@ -1,181 +1,190 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<view v-if="visibleSync" :class="{ 'uni-drawer--visible': showDrawer }" class="uni-drawer" @touchmove.stop.prevent="clear">
|
|
3
|
+
<view class="uni-drawer__mask" :class="{ 'uni-drawer__mask--visible': showDrawer && mask }" @tap="close('mask')" />
|
|
4
|
+
<view
|
|
5
|
+
class="uni-drawer__content"
|
|
6
|
+
:class="{ 'uni-drawer--right': rightMode, 'uni-drawer--left': !rightMode, 'uni-drawer__content--visible': showDrawer }"
|
|
7
|
+
:style="{ width: drawerWidth + 'px' }"
|
|
8
|
+
>
|
|
9
|
+
<slot />
|
|
10
|
+
</view>
|
|
11
|
+
<!-- #ifdef H5 -->
|
|
12
|
+
<keypress @esc="close('mask')" />
|
|
13
|
+
<!-- #endif -->
|
|
14
|
+
</view>
|
|
11
15
|
</template>
|
|
12
16
|
|
|
13
17
|
<script>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
18
|
+
// #ifdef H5
|
|
19
|
+
import keypress from './keypress.js';
|
|
20
|
+
// #endif
|
|
21
|
+
/**
|
|
22
|
+
* Drawer 抽屉
|
|
23
|
+
* @description 抽屉侧滑菜单
|
|
24
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=26
|
|
25
|
+
* @property {Boolean} mask = [true | false] 是否显示遮罩
|
|
26
|
+
* @property {Boolean} maskClick = [true | false] 点击遮罩是否关闭
|
|
27
|
+
* @property {Boolean} mode = [left | right] Drawer 滑出位置
|
|
28
|
+
* @value left 从左侧滑出
|
|
29
|
+
* @value right 从右侧侧滑出
|
|
30
|
+
* @property {Number} width 抽屉的宽度 ,仅 vue 页面生效
|
|
31
|
+
* @event {Function} close 组件关闭时触发事件
|
|
32
|
+
*/
|
|
33
|
+
export default {
|
|
34
|
+
name: 'UniDrawer',
|
|
35
|
+
components: {
|
|
36
|
+
// #ifdef H5
|
|
37
|
+
keypress,
|
|
38
|
+
// #endif
|
|
39
|
+
},
|
|
40
|
+
emits: ['change'],
|
|
41
|
+
props: {
|
|
42
|
+
/**
|
|
43
|
+
* 显示模式(左、右),只在初始化生效
|
|
44
|
+
*/
|
|
45
|
+
mode: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: '',
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* 蒙层显示状态
|
|
51
|
+
*/
|
|
52
|
+
mask: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true,
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* 遮罩是否可点击关闭
|
|
58
|
+
*/
|
|
59
|
+
maskClick: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true,
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* 抽屉宽度
|
|
65
|
+
*/
|
|
66
|
+
width: {
|
|
67
|
+
type: Number,
|
|
68
|
+
default: 220,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
visibleSync: false,
|
|
74
|
+
showDrawer: false,
|
|
75
|
+
rightMode: false,
|
|
76
|
+
watchTimer: null,
|
|
77
|
+
drawerWidth: 220,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
created() {
|
|
81
|
+
// #ifndef APP-NVUE
|
|
82
|
+
this.drawerWidth = this.width;
|
|
83
|
+
// #endif
|
|
84
|
+
this.rightMode = this.mode === 'right';
|
|
85
|
+
},
|
|
86
|
+
methods: {
|
|
87
|
+
clear() {},
|
|
88
|
+
close(type) {
|
|
89
|
+
// fixed by mehaotian 抽屉尚未完全关闭或遮罩禁止点击时不触发以下逻辑
|
|
90
|
+
if ((type === 'mask' && !this.maskClick) || !this.visibleSync) return;
|
|
91
|
+
this._change('showDrawer', 'visibleSync', false);
|
|
92
|
+
},
|
|
93
|
+
open() {
|
|
94
|
+
// fixed by mehaotian 处理重复点击打开的事件
|
|
95
|
+
if (this.visibleSync) return;
|
|
96
|
+
this._change('visibleSync', 'showDrawer', true);
|
|
97
|
+
},
|
|
98
|
+
_change(param1, param2, status) {
|
|
99
|
+
this[param1] = status;
|
|
100
|
+
if (this.watchTimer) {
|
|
101
|
+
clearTimeout(this.watchTimer);
|
|
102
|
+
}
|
|
103
|
+
this.watchTimer = setTimeout(
|
|
104
|
+
() => {
|
|
105
|
+
this[param2] = status;
|
|
106
|
+
this.$emit('change', status);
|
|
107
|
+
},
|
|
108
|
+
status ? 50 : 300,
|
|
109
|
+
);
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
};
|
|
106
113
|
</script>
|
|
107
114
|
|
|
108
|
-
<style lang="scss"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
<style lang="scss">
|
|
116
|
+
$uni-mask: rgba(
|
|
117
|
+
$color: #000000,
|
|
118
|
+
$alpha: 0.4,
|
|
119
|
+
);
|
|
120
|
+
// 抽屉宽度
|
|
121
|
+
$drawer-width: 220px;
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
.uni-drawer {
|
|
124
|
+
/* #ifndef APP-NVUE */
|
|
125
|
+
display: block;
|
|
126
|
+
/* #endif */
|
|
127
|
+
position: fixed;
|
|
128
|
+
top: 0;
|
|
129
|
+
left: 0;
|
|
130
|
+
right: 0;
|
|
131
|
+
bottom: 0;
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
z-index: 999;
|
|
134
|
+
}
|
|
125
135
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
.uni-drawer__content {
|
|
137
|
+
/* #ifndef APP-NVUE */
|
|
138
|
+
display: block;
|
|
139
|
+
/* #endif */
|
|
140
|
+
position: absolute;
|
|
141
|
+
top: 0;
|
|
142
|
+
width: $drawer-width;
|
|
143
|
+
bottom: 0;
|
|
144
|
+
background-color: $uni-bg-color;
|
|
145
|
+
}
|
|
136
146
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
.uni-drawer--left {
|
|
148
|
+
left: 0;
|
|
149
|
+
/* #ifdef APP-NVUE */
|
|
150
|
+
transform: translateX(-$drawer-width);
|
|
151
|
+
/* #endif */
|
|
152
|
+
/* #ifndef APP-NVUE */
|
|
153
|
+
transform: translateX(-100%);
|
|
154
|
+
/* #endif */
|
|
155
|
+
}
|
|
146
156
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
.uni-drawer--right {
|
|
158
|
+
right: 0;
|
|
159
|
+
/* #ifdef APP-NVUE */
|
|
160
|
+
transform: translateX($drawer-width);
|
|
161
|
+
/* #endif */
|
|
162
|
+
/* #ifndef APP-NVUE */
|
|
163
|
+
transform: translateX(100%);
|
|
164
|
+
/* #endif */
|
|
165
|
+
}
|
|
156
166
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
.uni-drawer__content--visible {
|
|
168
|
+
transform: translateX(0px);
|
|
169
|
+
}
|
|
160
170
|
|
|
171
|
+
.uni-drawer__mask {
|
|
172
|
+
/* #ifndef APP-NVUE */
|
|
173
|
+
display: block;
|
|
174
|
+
/* #endif */
|
|
175
|
+
opacity: 0;
|
|
176
|
+
position: absolute;
|
|
177
|
+
top: 0;
|
|
178
|
+
left: 0;
|
|
179
|
+
bottom: 0;
|
|
180
|
+
right: 0;
|
|
181
|
+
background-color: $uni-mask;
|
|
182
|
+
}
|
|
161
183
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
top: 0;
|
|
169
|
-
left: 0;
|
|
170
|
-
bottom: 0;
|
|
171
|
-
right: 0;
|
|
172
|
-
background-color: $uni-mask;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.uni-drawer__mask--visible {
|
|
176
|
-
/* #ifndef APP-NVUE */
|
|
177
|
-
display: block;
|
|
178
|
-
/* #endif */
|
|
179
|
-
opacity: 1;
|
|
180
|
-
}
|
|
184
|
+
.uni-drawer__mask--visible {
|
|
185
|
+
/* #ifndef APP-NVUE */
|
|
186
|
+
display: block;
|
|
187
|
+
/* #endif */
|
|
188
|
+
opacity: 1;
|
|
189
|
+
}
|
|
181
190
|
</style>
|
|
@@ -4,27 +4,25 @@
|
|
|
4
4
|
* @param wait 延迟执行毫秒数
|
|
5
5
|
* @param immediate true - 立即执行, false - 延迟执行
|
|
6
6
|
*/
|
|
7
|
-
export const debounce = function(func, wait = 1000, immediate = true) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
}
|
|
7
|
+
export const debounce = function (func, wait = 1000, immediate = true) {
|
|
8
|
+
let timer;
|
|
9
|
+
return function () {
|
|
10
|
+
let context = this,
|
|
11
|
+
args = arguments;
|
|
12
|
+
if (timer) clearTimeout(timer);
|
|
13
|
+
if (immediate) {
|
|
14
|
+
let callNow = !timer;
|
|
15
|
+
timer = setTimeout(() => {
|
|
16
|
+
timer = null;
|
|
17
|
+
}, wait);
|
|
18
|
+
if (callNow) func.apply(context, args);
|
|
19
|
+
} else {
|
|
20
|
+
timer = setTimeout(() => {
|
|
21
|
+
func.apply(context, args);
|
|
22
|
+
}, wait);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
28
26
|
/**
|
|
29
27
|
* @desc 函数节流
|
|
30
28
|
* @param func 函数
|
|
@@ -32,25 +30,25 @@ export const debounce = function(func, wait = 1000, immediate = true) {
|
|
|
32
30
|
* @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发
|
|
33
31
|
*/
|
|
34
32
|
export const throttle = (func, wait = 1000, type = 1) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
let previous = 0;
|
|
34
|
+
let timeout;
|
|
35
|
+
return function () {
|
|
36
|
+
let context = this;
|
|
37
|
+
let args = arguments;
|
|
38
|
+
if (type === 1) {
|
|
39
|
+
let now = Date.now();
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
41
|
+
if (now - previous > wait) {
|
|
42
|
+
func.apply(context, args);
|
|
43
|
+
previous = now;
|
|
44
|
+
}
|
|
45
|
+
} else if (type === 2) {
|
|
46
|
+
if (!timeout) {
|
|
47
|
+
timeout = setTimeout(() => {
|
|
48
|
+
timeout = null;
|
|
49
|
+
func.apply(context, args);
|
|
50
|
+
}, wait);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|