cbvirtua 1.0.102 → 1.0.103

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 (50) hide show
  1. package/package.json +1 -1
  2. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/.hbuilderx/launch.json +11 -0
  3. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/App.vue +17 -0
  4. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/README.md +13 -0
  5. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/code.js +408 -0
  6. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/css/icon.css +342 -0
  7. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/css/style.scss +119 -0
  8. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/search/index.vue +66 -0
  9. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/tree.vue +70 -0
  10. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/main.js +11 -0
  11. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/manifest.json +78 -0
  12. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/chooseUser/chooseUser.vue +69 -0
  13. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/chooseUser/data.js +96 -0
  14. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/index/index.vue +122 -0
  15. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages.json +25 -0
  16. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/changelog.md +80 -0
  17. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/en.json +7 -0
  18. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/index.js +8 -0
  19. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json +7 -0
  20. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json +7 -0
  21. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/keypress.js +45 -0
  22. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/popup.js +26 -0
  23. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue +90 -0
  24. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/uni-popup.vue +496 -0
  25. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js +45 -0
  26. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue +313 -0
  27. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue +143 -0
  28. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue +187 -0
  29. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/package.json +87 -0
  30. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/readme.md +17 -0
  31. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/changelog.md +8 -0
  32. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/index.scss +1 -0
  33. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/package.json +82 -0
  34. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/readme.md +4 -0
  35. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/index.scss +7 -0
  36. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_border.scss +3 -0
  37. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_color.scss +66 -0
  38. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_radius.scss +55 -0
  39. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_space.scss +56 -0
  40. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_styles.scss +167 -0
  41. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_text.scss +24 -0
  42. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_variables.scss +146 -0
  43. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/tools/functions.scss +19 -0
  44. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/theme.scss +31 -0
  45. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/variables.scss +62 -0
  46. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/changelog.md +22 -0
  47. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/components/uni-transition/createAnimation.js +131 -0
  48. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/components/uni-transition/uni-transition.vue +286 -0
  49. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/package.json +84 -0
  50. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/readme.md +11 -0
@@ -0,0 +1,496 @@
1
+ <template>
2
+ <view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']">
3
+ <view @touchstart="touchstart">
4
+ <uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass"
5
+ :duration="duration" :show="showTrans" @click="onTap" />
6
+ <uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration"
7
+ :show="showTrans" @click="onTap">
8
+ <view class="uni-popup__wrapper" :style="getStyles" :class="[popupstyle]" @click="clear">
9
+ <slot />
10
+ </view>
11
+ </uni-transition>
12
+ </view>
13
+ <!-- #ifdef H5 -->
14
+ <keypress v-if="maskShow" @esc="onTap" />
15
+ <!-- #endif -->
16
+ </view>
17
+ </template>
18
+
19
+ <script>
20
+ // #ifdef H5
21
+ import keypress from './keypress.js'
22
+ // #endif
23
+
24
+ /**
25
+ * PopUp 弹出层
26
+ * @description 弹出层组件,为了解决遮罩弹层的问题
27
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=329
28
+ * @property {String} type = [top|center|bottom|left|right|message|dialog|share] 弹出方式
29
+ * @value top 顶部弹出
30
+ * @value center 中间弹出
31
+ * @value bottom 底部弹出
32
+ * @value left 左侧弹出
33
+ * @value right 右侧弹出
34
+ * @value message 消息提示
35
+ * @value dialog 对话框
36
+ * @value share 底部分享示例
37
+ * @property {Boolean} animation = [true|false] 是否开启动画
38
+ * @property {Boolean} maskClick = [true|false] 蒙版点击是否关闭弹窗(废弃)
39
+ * @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
40
+ * @property {String} backgroundColor 主窗口背景色
41
+ * @property {String} maskBackgroundColor 蒙版颜色
42
+ * @property {Boolean} safeArea 是否适配底部安全区
43
+ * @event {Function} change 打开关闭弹窗触发,e={show: false}
44
+ * @event {Function} maskClick 点击遮罩触发
45
+ */
46
+
47
+ export default {
48
+ name: 'uniPopup',
49
+ components: {
50
+ // #ifdef H5
51
+ keypress
52
+ // #endif
53
+ },
54
+ emits: ['change', 'maskClick'],
55
+ props: {
56
+ // 开启动画
57
+ animation: {
58
+ type: Boolean,
59
+ default: true
60
+ },
61
+ // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
62
+ // message: 消息提示 ; dialog : 对话框
63
+ type: {
64
+ type: String,
65
+ default: 'center'
66
+ },
67
+ // maskClick
68
+ isMaskClick: {
69
+ type: Boolean,
70
+ default: null
71
+ },
72
+ // TODO 2 个版本后废弃属性 ,使用 isMaskClick
73
+ maskClick: {
74
+ type: Boolean,
75
+ default: null
76
+ },
77
+ backgroundColor: {
78
+ type: String,
79
+ default: 'none'
80
+ },
81
+ safeArea: {
82
+ type: Boolean,
83
+ default: true
84
+ },
85
+ maskBackgroundColor: {
86
+ type: String,
87
+ default: 'rgba(0, 0, 0, 0.4)'
88
+ },
89
+ borderRadius:{
90
+ type: String,
91
+ }
92
+ },
93
+
94
+ watch: {
95
+ /**
96
+ * 监听type类型
97
+ */
98
+ type: {
99
+ handler: function(type) {
100
+ if (!this.config[type]) return
101
+ this[this.config[type]](true)
102
+ },
103
+ immediate: true
104
+ },
105
+ isDesktop: {
106
+ handler: function(newVal) {
107
+ if (!this.config[newVal]) return
108
+ this[this.config[this.type]](true)
109
+ },
110
+ immediate: true
111
+ },
112
+ /**
113
+ * 监听遮罩是否可点击
114
+ * @param {Object} val
115
+ */
116
+ maskClick: {
117
+ handler: function(val) {
118
+ this.mkclick = val
119
+ },
120
+ immediate: true
121
+ },
122
+ isMaskClick: {
123
+ handler: function(val) {
124
+ this.mkclick = val
125
+ },
126
+ immediate: true
127
+ },
128
+ // H5 下禁止底部滚动
129
+ showPopup(show) {
130
+ // #ifdef H5
131
+ // fix by mehaotian 处理 h5 滚动穿透的问题
132
+ document.getElementsByTagName('body')[0].style.overflow = show ? 'hidden' : 'visible'
133
+ // #endif
134
+ }
135
+ },
136
+ data() {
137
+ return {
138
+ duration: 300,
139
+ ani: [],
140
+ showPopup: false,
141
+ showTrans: false,
142
+ popupWidth: 0,
143
+ popupHeight: 0,
144
+ config: {
145
+ top: 'top',
146
+ bottom: 'bottom',
147
+ center: 'center',
148
+ left: 'left',
149
+ right: 'right',
150
+ message: 'top',
151
+ dialog: 'center',
152
+ share: 'bottom'
153
+ },
154
+ maskClass: {
155
+ position: 'fixed',
156
+ bottom: 0,
157
+ top: 0,
158
+ left: 0,
159
+ right: 0,
160
+ backgroundColor: 'rgba(0, 0, 0, 0.4)'
161
+ },
162
+ transClass: {
163
+ backgroundColor: 'transparent',
164
+ borderRadius: this.borderRadius || "0",
165
+ position: 'fixed',
166
+ left: 0,
167
+ right: 0
168
+ },
169
+ maskShow: true,
170
+ mkclick: true,
171
+ popupstyle: 'top'
172
+ }
173
+ },
174
+ computed: {
175
+ getStyles() {
176
+ let res = { backgroundColor: this.bg };
177
+ if (this.borderRadius || "0") {
178
+ res = Object.assign(res, { borderRadius: this.borderRadius })
179
+ }
180
+ return res;
181
+ },
182
+ isDesktop() {
183
+ return this.popupWidth >= 500 && this.popupHeight >= 500
184
+ },
185
+ bg() {
186
+ if (this.backgroundColor === '' || this.backgroundColor === 'none') {
187
+ return 'transparent'
188
+ }
189
+ return this.backgroundColor
190
+ }
191
+ },
192
+ mounted() {
193
+ const fixSize = () => {
194
+ const {
195
+ windowWidth,
196
+ windowHeight,
197
+ windowTop,
198
+ safeArea,
199
+ screenHeight,
200
+ safeAreaInsets
201
+ } = uni.getSystemInfoSync()
202
+ this.popupWidth = windowWidth
203
+ this.popupHeight = windowHeight + (windowTop || 0)
204
+ // TODO fix by mehaotian 是否适配底部安全区 ,目前微信ios 、和 app ios 计算有差异,需要框架修复
205
+ if (safeArea && this.safeArea) {
206
+ // #ifdef MP-WEIXIN
207
+ this.safeAreaInsets = screenHeight - safeArea.bottom
208
+ // #endif
209
+ // #ifndef MP-WEIXIN
210
+ this.safeAreaInsets = safeAreaInsets.bottom
211
+ // #endif
212
+ } else {
213
+ this.safeAreaInsets = 0
214
+ }
215
+ }
216
+ fixSize()
217
+ // #ifdef H5
218
+ // window.addEventListener('resize', fixSize)
219
+ // this.$once('hook:beforeDestroy', () => {
220
+ // window.removeEventListener('resize', fixSize)
221
+ // })
222
+ // #endif
223
+ },
224
+ // #ifndef VUE3
225
+ // TODO vue2
226
+ destroyed() {
227
+ this.setH5Visible()
228
+ },
229
+ // #endif
230
+ // #ifdef VUE3
231
+ // TODO vue3
232
+ unmounted() {
233
+ this.setH5Visible()
234
+ },
235
+ // #endif
236
+ created() {
237
+ // this.mkclick = this.isMaskClick || this.maskClick
238
+ if (this.isMaskClick === null && this.maskClick === null) {
239
+ this.mkclick = true
240
+ } else {
241
+ this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick
242
+ }
243
+ if (this.animation) {
244
+ this.duration = 300
245
+ } else {
246
+ this.duration = 0
247
+ }
248
+ // TODO 处理 message 组件生命周期异常的问题
249
+ this.messageChild = null
250
+ // TODO 解决头条冒泡的问题
251
+ this.clearPropagation = false
252
+ this.maskClass.backgroundColor = this.maskBackgroundColor
253
+ },
254
+ methods: {
255
+ setH5Visible() {
256
+ // #ifdef H5
257
+ // fix by mehaotian 处理 h5 滚动穿透的问题
258
+ document.getElementsByTagName('body')[0].style.overflow = 'visible'
259
+ // #endif
260
+ },
261
+ /**
262
+ * 公用方法,不显示遮罩层
263
+ */
264
+ closeMask() {
265
+ this.maskShow = false
266
+ },
267
+ /**
268
+ * 公用方法,遮罩层禁止点击
269
+ */
270
+ disableMask() {
271
+ this.mkclick = false
272
+ },
273
+ // TODO nvue 取消冒泡
274
+ clear(e) {
275
+ // #ifndef APP-NVUE
276
+ e.stopPropagation()
277
+ // #endif
278
+ this.clearPropagation = true
279
+ },
280
+
281
+ open(direction) {
282
+ // fix by mehaotian 处理快速打开关闭的情况
283
+ if (this.showPopup) {
284
+ return
285
+ }
286
+ let innerType = ['top', 'center', 'bottom', 'left', 'right', 'message', 'dialog', 'share']
287
+ if (!(direction && innerType.indexOf(direction) !== -1)) {
288
+ direction = this.type
289
+ }
290
+ if (!this.config[direction]) {
291
+ console.error('缺少类型:', direction)
292
+ return
293
+ }
294
+ this[this.config[direction]]()
295
+ this.$emit('change', {
296
+ show: true,
297
+ type: direction
298
+ })
299
+ },
300
+ close(type) {
301
+ this.showTrans = false
302
+ this.$emit('change', {
303
+ show: false,
304
+ type: this.type
305
+ })
306
+ clearTimeout(this.timer)
307
+ // // 自定义关闭事件
308
+ // this.customOpen && this.customClose()
309
+ this.timer = setTimeout(() => {
310
+ this.showPopup = false
311
+ }, 300)
312
+ },
313
+ // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
314
+ touchstart() {
315
+ this.clearPropagation = false
316
+ },
317
+
318
+ onTap() {
319
+ if (this.clearPropagation) {
320
+ // fix by mehaotian 兼容 nvue
321
+ this.clearPropagation = false
322
+ return
323
+ }
324
+ this.$emit('maskClick')
325
+ if (!this.mkclick) return
326
+ this.close()
327
+ },
328
+ /**
329
+ * 顶部弹出样式处理
330
+ */
331
+ top(type) {
332
+ this.popupstyle = this.isDesktop ? 'fixforpc-top' : 'top'
333
+ this.ani = ['slide-top']
334
+ this.transClass = {
335
+ position: 'fixed',
336
+ left: 0,
337
+ right: 0,
338
+ backgroundColor: this.bg,
339
+ borderRadius:this.borderRadius || "0"
340
+ }
341
+ // TODO 兼容 type 属性 ,后续会废弃
342
+ if (type) return
343
+ this.showPopup = true
344
+ this.showTrans = true
345
+ this.$nextTick(() => {
346
+ if (this.messageChild && this.type === 'message') {
347
+ this.messageChild.timerClose()
348
+ }
349
+ })
350
+ },
351
+ /**
352
+ * 底部弹出样式处理
353
+ */
354
+ bottom(type) {
355
+ this.popupstyle = 'bottom'
356
+ this.ani = ['slide-bottom']
357
+ this.transClass = {
358
+ position: 'fixed',
359
+ left: 0,
360
+ right: 0,
361
+ bottom: 0,
362
+ paddingBottom: this.safeAreaInsets + 'px',
363
+ backgroundColor: this.bg,
364
+ borderRadius:this.borderRadius || "0",
365
+ }
366
+ // TODO 兼容 type 属性 ,后续会废弃
367
+ if (type) return
368
+ this.showPopup = true
369
+ this.showTrans = true
370
+ },
371
+ /**
372
+ * 中间弹出样式处理
373
+ */
374
+ center(type) {
375
+ this.popupstyle = 'center'
376
+ //微信小程序下,组合动画会出现文字向上闪动问题,再此做特殊处理
377
+ // #ifdef MP-WEIXIN
378
+ this.ani = ['fade']
379
+ // #endif
380
+ // #ifndef MP-WEIXIN
381
+ this.ani = ['zoom-out', 'fade']
382
+ // #endif
383
+ this.transClass = {
384
+ position: 'fixed',
385
+ /* #ifndef APP-NVUE */
386
+ display: 'flex',
387
+ flexDirection: 'column',
388
+ /* #endif */
389
+ bottom: 0,
390
+ left: 0,
391
+ right: 0,
392
+ top: 0,
393
+ justifyContent: 'center',
394
+ alignItems: 'center',
395
+ borderRadius:this.borderRadius || "0"
396
+ }
397
+ // TODO 兼容 type 属性 ,后续会废弃
398
+ if (type) return
399
+ this.showPopup = true
400
+ this.showTrans = true
401
+ },
402
+ left(type) {
403
+ this.popupstyle = 'left'
404
+ this.ani = ['slide-left']
405
+ this.transClass = {
406
+ position: 'fixed',
407
+ left: 0,
408
+ bottom: 0,
409
+ top: 0,
410
+ backgroundColor: this.bg,
411
+ borderRadius:this.borderRadius || "0",
412
+ /* #ifndef APP-NVUE */
413
+ display: 'flex',
414
+ flexDirection: 'column'
415
+ /* #endif */
416
+ }
417
+ // TODO 兼容 type 属性 ,后续会废弃
418
+ if (type) return
419
+ this.showPopup = true
420
+ this.showTrans = true
421
+ },
422
+ right(type) {
423
+ this.popupstyle = 'right'
424
+ this.ani = ['slide-right']
425
+ this.transClass = {
426
+ position: 'fixed',
427
+ bottom: 0,
428
+ right: 0,
429
+ top: 0,
430
+ backgroundColor: this.bg,
431
+ borderRadius:this.borderRadius || "0",
432
+ /* #ifndef APP-NVUE */
433
+ display: 'flex',
434
+ flexDirection: 'column'
435
+ /* #endif */
436
+ }
437
+ // TODO 兼容 type 属性 ,后续会废弃
438
+ if (type) return
439
+ this.showPopup = true
440
+ this.showTrans = true
441
+ }
442
+ }
443
+ }
444
+ </script>
445
+ <style lang="scss">
446
+ .uni-popup {
447
+ position: fixed;
448
+ /* #ifndef APP-NVUE */
449
+ z-index: 99;
450
+
451
+ /* #endif */
452
+ &.top,
453
+ &.left,
454
+ &.right {
455
+ /* #ifdef H5 */
456
+ top: var(--window-top);
457
+ /* #endif */
458
+ /* #ifndef H5 */
459
+ top: 0;
460
+ /* #endif */
461
+ }
462
+
463
+ .uni-popup__wrapper {
464
+ /* #ifndef APP-NVUE */
465
+ display: block;
466
+ /* #endif */
467
+ position: relative;
468
+
469
+ /* iphonex 等安全区设置,底部安全区适配 */
470
+ /* #ifndef APP-NVUE */
471
+ // padding-bottom: constant(safe-area-inset-bottom);
472
+ // padding-bottom: env(safe-area-inset-bottom);
473
+ /* #endif */
474
+ &.left,
475
+ &.right {
476
+ /* #ifdef H5 */
477
+ padding-top: var(--window-top);
478
+ /* #endif */
479
+ /* #ifndef H5 */
480
+ padding-top: 0;
481
+ /* #endif */
482
+ flex: 1;
483
+ }
484
+ }
485
+ }
486
+
487
+ .fixforpc-z-index {
488
+ /* #ifndef APP-NVUE */
489
+ z-index: 999;
490
+ /* #endif */
491
+ }
492
+
493
+ .fixforpc-top {
494
+ top: 0;
495
+ }
496
+ </style>
@@ -0,0 +1,45 @@
1
+ // #ifdef H5
2
+ export default {
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
+ // #endif