uview-plus 3.1.49 → 3.1.50

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 (155) hide show
  1. package/README.md +10 -10
  2. package/changelog.md +5 -14
  3. package/components/u-action-sheet/props.js +11 -10
  4. package/components/u-album/props.js +12 -11
  5. package/components/u-alert/props.js +9 -8
  6. package/components/u-avatar/props.js +15 -14
  7. package/components/u-avatar-group/props.js +10 -9
  8. package/components/u-back-top/props.js +11 -10
  9. package/components/u-back-top/u-back-top.vue +1 -1
  10. package/components/u-badge/props.js +15 -14
  11. package/components/u-badge/u-badge.vue +1 -1
  12. package/components/u-button/props.js +29 -28
  13. package/components/u-calendar/month.vue +1 -1
  14. package/components/u-calendar/props.js +28 -27
  15. package/components/u-car-keyboard/props.js +1 -0
  16. package/components/u-car-keyboard/u-car-keyboard.vue +1 -1
  17. package/components/u-cell/props.js +18 -17
  18. package/components/u-cell/u-cell.vue +3 -12
  19. package/components/u-cell-group/props.js +3 -2
  20. package/components/u-cell-group/u-cell-group.vue +1 -1
  21. package/components/u-checkbox/props.js +14 -13
  22. package/components/u-checkbox/u-checkbox.vue +1 -1
  23. package/components/u-checkbox-group/props.js +17 -16
  24. package/components/u-circle-progress/props.js +2 -1
  25. package/components/u-code/props.js +7 -6
  26. package/components/u-code/u-code.vue +0 -5
  27. package/components/u-code-input/props.js +17 -16
  28. package/components/u-col/props.js +6 -5
  29. package/components/u-collapse/props.js +4 -3
  30. package/components/u-collapse-item/props.js +12 -11
  31. package/components/u-column-notice/props.js +11 -10
  32. package/components/u-count-down/props.js +5 -4
  33. package/components/u-count-down/u-count-down.vue +1 -6
  34. package/components/u-count-to/props.js +12 -11
  35. package/components/u-datetime-picker/props.js +25 -37
  36. package/components/u-datetime-picker/u-datetime-picker.vue +3 -22
  37. package/components/u-divider/props.js +9 -8
  38. package/components/u-dropdown/props.js +1 -0
  39. package/components/u-dropdown-item/props.js +1 -0
  40. package/components/u-empty/props.js +12 -11
  41. package/components/u-form/props.js +9 -8
  42. package/components/u-form/u-form.vue +1 -1
  43. package/components/u-form-item/props.js +9 -13
  44. package/components/u-form-item/u-form-item.vue +0 -1
  45. package/components/u-gap/props.js +5 -4
  46. package/components/u-grid/props.js +4 -3
  47. package/components/u-grid-item/props.js +3 -2
  48. package/components/u-grid-item/u-grid-item.vue +0 -5
  49. package/components/u-icon/props.js +18 -17
  50. package/components/u-icon/u-icon.vue +6 -9
  51. package/components/u-image/props.js +17 -16
  52. package/components/u-image/u-image.vue +1 -1
  53. package/components/u-index-anchor/props.js +6 -5
  54. package/components/u-index-anchor/u-index-anchor.vue +1 -1
  55. package/components/u-index-item/props.js +1 -0
  56. package/components/u-index-item/u-index-item.vue +1 -1
  57. package/components/u-index-list/props.js +6 -5
  58. package/components/u-index-list/u-index-list.vue +2 -3
  59. package/components/u-input/props.js +36 -35
  60. package/components/u-input/u-input.vue +4 -10
  61. package/components/u-keyboard/props.js +17 -16
  62. package/components/u-line/props.js +7 -6
  63. package/components/u-line-progress/props.js +6 -5
  64. package/components/u-link/props.js +8 -7
  65. package/components/u-list/props.js +15 -14
  66. package/components/u-list-item/props.js +2 -1
  67. package/components/u-loading-icon/props.js +12 -11
  68. package/components/u-loading-page/props.js +10 -9
  69. package/components/u-loadmore/props.js +19 -18
  70. package/components/u-modal/props.js +17 -16
  71. package/components/u-navbar/props.js +17 -16
  72. package/components/u-no-network/props.js +4 -3
  73. package/components/u-notice-bar/props.js +14 -13
  74. package/components/u-notify/props.js +10 -9
  75. package/components/u-notify/u-notify.vue +0 -5
  76. package/components/u-number-box/props.js +23 -22
  77. package/components/u-number-box/u-number-box.vue +1 -21
  78. package/components/u-number-keyboard/props.js +4 -3
  79. package/components/u-overlay/props.js +5 -4
  80. package/components/u-parse/props.js +9 -8
  81. package/components/u-parse/u-parse.vue +1 -6
  82. package/components/u-picker/props.js +17 -16
  83. package/components/u-picker-column/props.js +1 -0
  84. package/components/u-popup/props.js +16 -15
  85. package/components/u-radio/props.js +14 -13
  86. package/components/u-radio-group/props.js +18 -17
  87. package/components/u-rate/props.js +15 -14
  88. package/components/u-read-more/props.js +9 -8
  89. package/components/u-row/props.js +4 -3
  90. package/components/u-row-notice/props.js +8 -7
  91. package/components/u-row-notice/u-row-notice.vue +0 -5
  92. package/components/u-safe-bottom/props.js +1 -0
  93. package/components/u-scroll-list/props.js +7 -6
  94. package/components/u-search/props.js +25 -24
  95. package/components/u-skeleton/props.js +12 -11
  96. package/components/u-slider/props.js +12 -11
  97. package/components/u-status-bar/props.js +2 -1
  98. package/components/u-status-bar/u-status-bar.vue +1 -1
  99. package/components/u-steps/props.js +8 -7
  100. package/components/u-steps/u-steps.vue +1 -1
  101. package/components/u-steps-item/props.js +5 -4
  102. package/components/u-steps-item/u-steps-item.vue +1 -1
  103. package/components/u-sticky/props.js +7 -6
  104. package/components/u-sticky/u-sticky.vue +0 -5
  105. package/components/u-subsection/props.js +10 -9
  106. package/components/u-swipe-action/props.js +2 -1
  107. package/components/u-swipe-action-item/nvue.js +0 -5
  108. package/components/u-swipe-action-item/props.js +7 -6
  109. package/components/u-swiper/props.js +25 -24
  110. package/components/u-swiper-indicator/props.js +6 -5
  111. package/components/u-switch/props.js +12 -11
  112. package/components/u-tabbar/props.js +9 -8
  113. package/components/u-tabbar-item/props.js +7 -6
  114. package/components/u-table/props.js +1 -0
  115. package/components/u-tabs/props.js +13 -12
  116. package/components/u-tabs-item/props.js +1 -0
  117. package/components/u-tag/props.js +16 -15
  118. package/components/u-td/props.js +1 -0
  119. package/components/u-text/props.js +22 -21
  120. package/components/u-textarea/props.js +24 -23
  121. package/components/u-toast/u-toast.vue +0 -5
  122. package/components/u-toolbar/props.js +7 -6
  123. package/components/u-tooltip/props.js +12 -11
  124. package/components/u-tr/props.js +1 -0
  125. package/components/u-transition/props.js +5 -4
  126. package/components/u-transition/transition.js +9 -8
  127. package/components/u-transition/u-transition.vue +1 -1
  128. package/components/u-upload/props.js +23 -22
  129. package/components/u-upload/u-upload.vue +1 -1
  130. package/index.js +5 -1
  131. package/libs/config/props/actionSheet.js +1 -1
  132. package/libs/config/props/album.js +1 -1
  133. package/libs/config/props/avatarGroup.js +1 -1
  134. package/libs/config/props/backtop.js +2 -2
  135. package/libs/config/props/badge.js +1 -1
  136. package/libs/config/props/calendar.js +3 -3
  137. package/libs/config/props/checkboxGroup.js +1 -1
  138. package/libs/config/props/datetimePicker.js +1 -1
  139. package/libs/config/props/form.js +3 -3
  140. package/libs/config/props/formItem.js +0 -1
  141. package/libs/config/props/indexList.js +1 -1
  142. package/libs/config/props/noticeBar.js +1 -1
  143. package/libs/config/props/picker.js +2 -2
  144. package/libs/config/props/popup.js +1 -1
  145. package/libs/config/props/search.js +2 -2
  146. package/libs/config/props/slider.js +1 -1
  147. package/libs/config/props/swiper.js +1 -1
  148. package/libs/config/props/tabs.js +7 -7
  149. package/libs/config/props/text.js +2 -2
  150. package/libs/config/props/toast.js +1 -1
  151. package/libs/config/props/tooltip.js +1 -1
  152. package/libs/config/props/upload.js +3 -3
  153. package/libs/css/components.scss +1 -11
  154. package/libs/css/flex.scss +71 -73
  155. package/package.json +1 -1
@@ -1,110 +1,111 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 主题颜色
4
5
  type: {
5
6
  type: String,
6
- default: () => uni.$u.props.text.type
7
+ default: defprops.text.type
7
8
  },
8
9
  // 是否显示
9
10
  show: {
10
11
  type: Boolean,
11
- default: () => uni.$u.props.text.show
12
+ default: defprops.text.show
12
13
  },
13
14
  // 显示的值
14
15
  text: {
15
16
  type: [String, Number],
16
- default: () => uni.$u.props.text.text
17
+ default: defprops.text.text
17
18
  },
18
19
  // 前置图标
19
20
  prefixIcon: {
20
21
  type: String,
21
- default: () => uni.$u.props.text.prefixIcon
22
+ default: defprops.text.prefixIcon
22
23
  },
23
24
  // 后置图标
24
25
  suffixIcon: {
25
26
  type: String,
26
- default: () => uni.$u.props.text.suffixIcon
27
+ default: defprops.text.suffixIcon
27
28
  },
28
29
  // 文本处理的匹配模式
29
30
  // text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
30
31
  mode: {
31
32
  type: String,
32
- default: () => uni.$u.props.text.mode
33
+ default: defprops.text.mode
33
34
  },
34
35
  // mode=link下,配置的链接
35
36
  href: {
36
37
  type: String,
37
- default: () => uni.$u.props.text.href
38
+ default: defprops.text.href
38
39
  },
39
40
  // 格式化规则
40
41
  format: {
41
42
  type: [String, Function],
42
- default: () => uni.$u.props.text.format
43
+ default: defprops.text.format
43
44
  },
44
45
  // mode=phone时,点击文本是否拨打电话
45
46
  call: {
46
47
  type: Boolean,
47
- default: () => uni.$u.props.text.call
48
+ default: defprops.text.call
48
49
  },
49
50
  // 小程序的打开方式
50
51
  openType: {
51
52
  type: String,
52
- default: () => uni.$u.props.text.openType
53
+ default: defprops.text.openType
53
54
  },
54
55
  // 是否粗体,默认normal
55
56
  bold: {
56
57
  type: Boolean,
57
- default: () => uni.$u.props.text.bold
58
+ default: defprops.text.bold
58
59
  },
59
60
  // 是否块状
60
61
  block: {
61
62
  type: Boolean,
62
- default: () => uni.$u.props.text.block
63
+ default: defprops.text.block
63
64
  },
64
65
  // 文本显示的行数,如果设置,超出此行数,将会显示省略号
65
66
  lines: {
66
67
  type: [String, Number],
67
- default: () => uni.$u.props.text.lines
68
+ default: defprops.text.lines
68
69
  },
69
70
  // 文本颜色
70
71
  color: {
71
72
  type: String,
72
- default: () => uni.$u.props.text.color
73
+ default: defprops.text.color
73
74
  },
74
75
  // 字体大小
75
76
  size: {
76
77
  type: [String, Number],
77
- default: () => uni.$u.props.text.size
78
+ default: defprops.text.size
78
79
  },
79
80
  // 图标的样式
80
81
  iconStyle: {
81
82
  type: [Object, String],
82
- default: () => uni.$u.props.text.iconStyle
83
+ default: defprops.text.iconStyle
83
84
  },
84
85
  // 文字装饰,下划线,中划线等,可选值 none|underline|line-through
85
86
  decoration: {
86
87
  tepe: String,
87
- default: () => uni.$u.props.text.decoration
88
+ default: defprops.text.decoration
88
89
  },
89
90
  // 外边距,对象、字符串,数值形式均可
90
91
  margin: {
91
92
  type: [Object, String, Number],
92
- default: () => uni.$u.props.text.margin
93
+ default: defprops.text.margin
93
94
  },
94
95
  // 文本行高
95
96
  lineHeight: {
96
97
  type: [String, Number],
97
- default: () => uni.$u.props.text.lineHeight
98
+ default: defprops.text.lineHeight
98
99
  },
99
100
  // 文本对齐方式,可选值left|center|right
100
101
  align: {
101
102
  type: String,
102
- default: () => uni.$u.props.text.align
103
+ default: defprops.text.align
103
104
  },
104
105
  // 文字换行,可选值break-word|normal|anywhere
105
106
  wordWrap: {
106
107
  type: String,
107
- default: () => uni.$u.props.text.wordWrap
108
+ default: defprops.text.wordWrap
108
109
  }
109
110
  }
110
111
  }
@@ -1,119 +1,120 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 输入框的内容
4
5
  value: {
5
6
  type: [String, Number],
6
- default: () => uni.$u.props.textarea.value
7
+ default: defprops.textarea.value
7
8
  },
8
9
  // 输入框的内容
9
10
  modelValue: {
10
11
  type: [String, Number],
11
- default: () => uni.$u.props.textarea.value
12
+ default: defprops.textarea.value
12
13
  },
13
14
  // 输入框为空时占位符
14
15
  placeholder: {
15
16
  type: [String, Number],
16
- default: () => uni.$u.props.textarea.placeholder
17
+ default: defprops.textarea.placeholder
17
18
  },
18
19
  // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
19
20
  placeholderClass: {
20
21
  type: String,
21
- default: () => uni.$u.props.input.placeholderClass
22
+ default: defprops.input.placeholderClass
22
23
  },
23
24
  // 指定placeholder的样式
24
25
  placeholderStyle: {
25
26
  type: [String, Object],
26
- default: () => uni.$u.props.input.placeholderStyle
27
+ default: defprops.input.placeholderStyle
27
28
  },
28
29
  // 输入框高度
29
30
  height: {
30
31
  type: [String, Number],
31
- default: () => uni.$u.props.textarea.height
32
+ default: defprops.textarea.height
32
33
  },
33
34
  // 设置键盘右下角按钮的文字,仅微信小程序,App-vue和H5有效
34
35
  confirmType: {
35
36
  type: String,
36
- default: () => uni.$u.props.textarea.confirmType
37
+ default: defprops.textarea.confirmType
37
38
  },
38
39
  // 是否禁用
39
40
  disabled: {
40
41
  type: Boolean,
41
- default: () => uni.$u.props.textarea.disabled
42
+ default: defprops.textarea.disabled
42
43
  },
43
44
  // 是否显示统计字数
44
45
  count: {
45
46
  type: Boolean,
46
- default: () => uni.$u.props.textarea.count
47
+ default: defprops.textarea.count
47
48
  },
48
49
  // 是否自动获取焦点,nvue不支持,H5取决于浏览器的实现
49
50
  focus: {
50
51
  type: Boolean,
51
- default: () => uni.$u.props.textarea.focus
52
+ default: defprops.textarea.focus
52
53
  },
53
54
  // 是否自动增加高度
54
55
  autoHeight: {
55
56
  type: Boolean,
56
- default: () => uni.$u.props.textarea.autoHeight
57
+ default: defprops.textarea.autoHeight
57
58
  },
58
59
  // 如果textarea是在一个position:fixed的区域,需要显示指定属性fixed为true
59
60
  fixed: {
60
61
  type: Boolean,
61
- default: () => uni.$u.props.textarea.fixed
62
+ default: defprops.textarea.fixed
62
63
  },
63
64
  // 指定光标与键盘的距离
64
65
  cursorSpacing: {
65
66
  type: Number,
66
- default: () => uni.$u.props.textarea.cursorSpacing
67
+ default: defprops.textarea.cursorSpacing
67
68
  },
68
69
  // 指定focus时的光标位置
69
70
  cursor: {
70
71
  type: [String, Number],
71
- default: () => uni.$u.props.textarea.cursor
72
+ default: defprops.textarea.cursor
72
73
  },
73
74
  // 是否显示键盘上方带有”完成“按钮那一栏,
74
75
  showConfirmBar: {
75
76
  type: Boolean,
76
- default: () => uni.$u.props.textarea.showConfirmBar
77
+ default: defprops.textarea.showConfirmBar
77
78
  },
78
79
  // 光标起始位置,自动聚焦时有效,需与selection-end搭配使用
79
80
  selectionStart: {
80
81
  type: Number,
81
- default: () => uni.$u.props.textarea.selectionStart
82
+ default: defprops.textarea.selectionStart
82
83
  },
83
84
  // 光标结束位置,自动聚焦时有效,需与selection-start搭配使用
84
85
  selectionEnd: {
85
86
  type: Number,
86
- default: () => uni.$u.props.textarea.selectionEnd
87
+ default: defprops.textarea.selectionEnd
87
88
  },
88
89
  // 键盘弹起时,是否自动上推页面
89
90
  adjustPosition: {
90
91
  type: Boolean,
91
- default: () => uni.$u.props.textarea.adjustPosition
92
+ default: defprops.textarea.adjustPosition
92
93
  },
93
94
  // 是否去掉 iOS 下的默认内边距,只微信小程序有效
94
95
  disableDefaultPadding: {
95
96
  type: Boolean,
96
- default: () => uni.$u.props.textarea.disableDefaultPadding
97
+ default: defprops.textarea.disableDefaultPadding
97
98
  },
98
99
  // focus时,点击页面的时候不收起键盘,只微信小程序有效
99
100
  holdKeyboard: {
100
101
  type: Boolean,
101
- default: () => uni.$u.props.textarea.holdKeyboard
102
+ default: defprops.textarea.holdKeyboard
102
103
  },
103
104
  // 最大输入长度,设置为 -1 的时候不限制最大长度
104
105
  maxlength: {
105
106
  type: [String, Number],
106
- default: () => uni.$u.props.textarea.maxlength
107
+ default: defprops.textarea.maxlength
107
108
  },
108
109
  // 边框类型,surround-四周边框,bottom-底部边框
109
110
  border: {
110
111
  type: String,
111
- default: () => uni.$u.props.textarea.border
112
+ default: defprops.textarea.border
112
113
  },
113
114
  // 用于处理或者过滤输入框内容的方法
114
115
  formatter: {
115
116
  type: [Function, null],
116
- default: () => uni.$u.props.textarea.formatter
117
+ default: defprops.textarea.formatter
117
118
  },
118
119
  // 是否忽略组件内对文本合成系统事件的处理
119
120
  ignoreCompositionEvent: {
@@ -175,12 +175,7 @@
175
175
  this.timer = null
176
176
  }
177
177
  },
178
- // #ifdef VUE2
179
178
  beforeDestroy() {
180
- // #endif
181
- // #ifdef VUE3
182
- beforeUnmount() {
183
- // #endif
184
179
  this.clearTimer()
185
180
  }
186
181
  }
@@ -1,34 +1,35 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 是否展示工具条
4
5
  show: {
5
6
  type: Boolean,
6
- default: () => uni.$u.props.toolbar.show
7
+ default: defprops.toolbar.show
7
8
  },
8
9
  // 取消按钮的文字
9
10
  cancelText: {
10
11
  type: String,
11
- default: () => uni.$u.props.toolbar.cancelText
12
+ default: defprops.toolbar.cancelText
12
13
  },
13
14
  // 确认按钮的文字
14
15
  confirmText: {
15
16
  type: String,
16
- default: () => uni.$u.props.toolbar.confirmText
17
+ default: defprops.toolbar.confirmText
17
18
  },
18
19
  // 取消按钮的颜色
19
20
  cancelColor: {
20
21
  type: String,
21
- default: () => uni.$u.props.toolbar.cancelColor
22
+ default: defprops.toolbar.cancelColor
22
23
  },
23
24
  // 确认按钮的颜色
24
25
  confirmColor: {
25
26
  type: String,
26
- default: () => uni.$u.props.toolbar.confirmColor
27
+ default: defprops.toolbar.confirmColor
27
28
  },
28
29
  // 标题文字
29
30
  title: {
30
31
  type: String,
31
- default: () => uni.$u.props.toolbar.title
32
+ default: defprops.toolbar.title
32
33
  }
33
34
  }
34
35
  }
@@ -1,59 +1,60 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 需要显示的提示文字
4
5
  text: {
5
6
  type: [String, Number],
6
- default: () => uni.$u.props.tooltip.text
7
+ default: defprops.tooltip.text
7
8
  },
8
9
  // 点击复制按钮时,复制的文本,为空则使用text值
9
10
  copyText: {
10
11
  type: [String, Number],
11
- default: () => uni.$u.props.tooltip.copyText
12
+ default: defprops.tooltip.copyText
12
13
  },
13
14
  // 文本大小
14
15
  size: {
15
16
  type: [String, Number],
16
- default: () => uni.$u.props.tooltip.size
17
+ default: defprops.tooltip.size
17
18
  },
18
19
  // 字体颜色
19
20
  color: {
20
21
  type: String,
21
- default: () => uni.$u.props.tooltip.color
22
+ default: defprops.tooltip.color
22
23
  },
23
24
  // 弹出提示框时,文本的背景色
24
25
  bgColor: {
25
26
  type: String,
26
- default: () => uni.$u.props.tooltip.bgColor
27
+ default: defprops.tooltip.bgColor
27
28
  },
28
29
  // 弹出提示的方向,top-上方,bottom-下方
29
30
  direction: {
30
31
  type: String,
31
- default: () => uni.$u.props.tooltip.direction
32
+ default: defprops.tooltip.direction
32
33
  },
33
34
  // 弹出提示的z-index,nvue无效
34
35
  zIndex: {
35
36
  type: [String, Number],
36
- default: () => uni.$u.props.tooltip.zIndex
37
+ default: defprops.tooltip.zIndex
37
38
  },
38
39
  // 是否显示复制按钮
39
40
  showCopy: {
40
41
  type: Boolean,
41
- default: () => uni.$u.props.tooltip.showCopy
42
+ default: defprops.tooltip.showCopy
42
43
  },
43
44
  // 扩展的按钮组
44
45
  buttons: {
45
46
  type: Array,
46
- default: () => uni.$u.props.tooltip.buttons
47
+ default: defprops.tooltip.buttons
47
48
  },
48
49
  // 是否显示透明遮罩以防止触摸穿透
49
50
  overlay: {
50
51
  type: Boolean,
51
- default: () => uni.$u.props.tooltip.overlay
52
+ default: defprops.tooltip.overlay
52
53
  },
53
54
  // 是否显示复制成功或者失败的toast
54
55
  showToast: {
55
56
  type: Boolean,
56
- default: () => uni.$u.props.tooltip.showToast
57
+ default: defprops.tooltip.showToast
57
58
  }
58
59
  }
59
60
  }
@@ -1,3 +1,4 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
 
@@ -1,24 +1,25 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 是否展示组件
4
5
  show: {
5
6
  type: Boolean,
6
- default: () => uni.$u.props.transition.show
7
+ default: defprops.transition.show
7
8
  },
8
9
  // 使用的动画模式
9
10
  mode: {
10
11
  type: String,
11
- default: () => uni.$u.props.transition.mode
12
+ default: defprops.transition.mode
12
13
  },
13
14
  // 动画的执行时间,单位ms
14
15
  duration: {
15
16
  type: [String, Number],
16
- default: () => uni.$u.props.transition.duration
17
+ default: defprops.transition.duration
17
18
  },
18
19
  // 使用的动画过渡函数
19
20
  timingFunction: {
20
21
  type: String,
21
- default: () => uni.$u.props.transition.timingFunction
22
+ default: defprops.transition.timingFunction
22
23
  }
23
24
  }
24
25
  }
@@ -1,8 +1,8 @@
1
1
  // 定义一个一定时间后自动成功的promise,让调用nextTick方法处,进入下一个then方法
2
2
  const waitTick = () => new Promise(resolve => setTimeout(resolve, 1000 / 50))
3
3
  // nvue动画模块实现细节抽离在外部文件
4
- // #ifdef APP-NVUE
5
- import animationMap from './nvue-ani-map.js'
4
+ // #ifdef APP-NVUE
5
+ import animationMap from './nvue-ani-map.js'
6
6
  // #endif
7
7
 
8
8
  // #ifndef APP-NVUE
@@ -20,8 +20,8 @@ const getClassNames = (name) => ({
20
20
  // https://weex.apache.org/zh/docs/modules/animation.html#transition
21
21
  const animation = uni.requireNativePlugin('animation')
22
22
  const getStyle = (name) => animationMap[name]
23
- // #endif
24
-
23
+ // #endif
24
+
25
25
  import { nextTick } from 'vue'
26
26
 
27
27
  export default {
@@ -41,10 +41,11 @@ export default {
41
41
  this.inited = true
42
42
  this.display = true
43
43
  this.classes = classNames.enter
44
- await nextTick();
44
+ await nextTick();
45
45
  {
46
- // https://github.com/umicro/uView2.0/issues/545
46
+ // #ifdef H5
47
47
  await uni.$u.sleep(20)
48
+ // #endif
48
49
  // 标识动画尚未结束
49
50
  this.$emit('enter')
50
51
  this.transitionEnded = false
@@ -65,7 +66,7 @@ export default {
65
66
  // 获得类名
66
67
  this.classes = classNames.leave
67
68
 
68
- await nextTick();
69
+ await nextTick();
69
70
  {
70
71
  // 动画正在离场的状态
71
72
  this.transitionEnded = false
@@ -93,7 +94,7 @@ export default {
93
94
  opacity: 0
94
95
  }
95
96
  // 等待弹窗内容渲染完成
96
- await nextTick();
97
+ await nextTick();
97
98
  {
98
99
  // 合并样式
99
100
  this.viewStyle = currentStyle.enter
@@ -6,7 +6,7 @@
6
6
  @tap="clickHandler"
7
7
  :class="classes"
8
8
  :style="[mergeStyle]"
9
- @touchmove.stop.prevent="noop"
9
+ @touchmove="noop"
10
10
  >
11
11
  <slot />
12
12
  </view>
@@ -1,44 +1,45 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 接受的文件类型, 可选值为all media image file video
4
5
  accept: {
5
6
  type: String,
6
- default: () => uni.$u.props.upload.accept
7
+ default: defprops.upload.accept
7
8
  },
8
9
  // 图片或视频拾取模式,当accept为image类型时设置capture可选额外camera可以直接调起摄像头
9
10
  capture: {
10
11
  type: [String, Array],
11
- default: () => uni.$u.props.upload.capture
12
+ default: defprops.upload.capture
12
13
  },
13
14
  // 当accept为video时生效,是否压缩视频,默认为true
14
15
  compressed: {
15
16
  type: Boolean,
16
- default: () => uni.$u.props.upload.compressed
17
+ default: defprops.upload.compressed
17
18
  },
18
19
  // 当accept为video时生效,可选值为back或front
19
20
  camera: {
20
21
  type: String,
21
- default: () => uni.$u.props.upload.camera
22
+ default: defprops.upload.camera
22
23
  },
23
24
  // 当accept为video时生效,拍摄视频最长拍摄时间,单位秒
24
25
  maxDuration: {
25
26
  type: Number,
26
- default: () => uni.$u.props.upload.maxDuration
27
+ default: defprops.upload.maxDuration
27
28
  },
28
29
  // 上传区域的图标,只能内置图标
29
30
  uploadIcon: {
30
31
  type: String,
31
- default: () => uni.$u.props.upload.uploadIcon
32
+ default: defprops.upload.uploadIcon
32
33
  },
33
34
  // 上传区域的图标的颜色,默认
34
35
  uploadIconColor: {
35
36
  type: String,
36
- default: () => uni.$u.props.upload.uploadIconColor
37
+ default: defprops.upload.uploadIconColor
37
38
  },
38
39
  // 是否开启文件读取前事件
39
40
  useBeforeRead: {
40
41
  type: Boolean,
41
- default: () => uni.$u.props.upload.useBeforeRead
42
+ default: defprops.upload.useBeforeRead
42
43
  },
43
44
  // 读取后的处理函数
44
45
  afterRead: {
@@ -53,72 +54,72 @@ export default {
53
54
  // 是否显示组件自带的图片预览功能
54
55
  previewFullImage: {
55
56
  type: Boolean,
56
- default: () => uni.$u.props.upload.previewFullImage
57
+ default: defprops.upload.previewFullImage
57
58
  },
58
59
  // 最大上传数量
59
60
  maxCount: {
60
61
  type: [String, Number],
61
- default: () => uni.$u.props.upload.maxCount
62
+ default: defprops.upload.maxCount
62
63
  },
63
64
  // 是否启用
64
65
  disabled: {
65
66
  type: Boolean,
66
- default: () => uni.$u.props.upload.disabled
67
+ default: defprops.upload.disabled
67
68
  },
68
69
  // 预览上传的图片时的裁剪模式,和image组件mode属性一致
69
70
  imageMode: {
70
71
  type: String,
71
- default: () => uni.$u.props.upload.imageMode
72
+ default: defprops.upload.imageMode
72
73
  },
73
74
  // 标识符,可以在回调函数的第二项参数中获取
74
75
  name: {
75
76
  type: String,
76
- default: () => uni.$u.props.upload.name
77
+ default: defprops.upload.name
77
78
  },
78
79
  // 所选的图片的尺寸, 可选值为original compressed
79
80
  sizeType: {
80
81
  type: Array,
81
- default: () => uni.$u.props.upload.sizeType
82
+ default: defprops.upload.sizeType
82
83
  },
83
84
  // 是否开启图片多选,部分安卓机型不支持
84
85
  multiple: {
85
86
  type: Boolean,
86
- default: () => uni.$u.props.upload.multiple
87
+ default: defprops.upload.multiple
87
88
  },
88
89
  // 是否展示删除按钮
89
90
  deletable: {
90
91
  type: Boolean,
91
- default: () => uni.$u.props.upload.deletable
92
+ default: defprops.upload.deletable
92
93
  },
93
94
  // 文件大小限制,单位为byte
94
95
  maxSize: {
95
96
  type: [String, Number],
96
- default: () => uni.$u.props.upload.maxSize
97
+ default: defprops.upload.maxSize
97
98
  },
98
99
  // 显示已上传的文件列表
99
100
  fileList: {
100
101
  type: Array,
101
- default: () => uni.$u.props.upload.fileList
102
+ default: defprops.upload.fileList
102
103
  },
103
104
  // 上传区域的提示文字
104
105
  uploadText: {
105
106
  type: String,
106
- default: () => uni.$u.props.upload.uploadText
107
+ default: defprops.upload.uploadText
107
108
  },
108
109
  // 内部预览图片区域和选择图片按钮的区域宽度
109
110
  width: {
110
111
  type: [String, Number],
111
- default: () => uni.$u.props.upload.width
112
+ default: defprops.upload.width
112
113
  },
113
114
  // 内部预览图片区域和选择图片按钮的区域高度
114
115
  height: {
115
116
  type: [String, Number],
116
- default: () => uni.$u.props.upload.height
117
+ default: defprops.upload.height
117
118
  },
118
119
  // 是否在上传完成后展示预览图
119
120
  previewImage: {
120
121
  type: Boolean,
121
- default: () => uni.$u.props.upload.previewImage
122
+ default: defprops.upload.previewImage
122
123
  }
123
124
  }
124
125
  }
@@ -136,7 +136,7 @@
136
136
  /**
137
137
  * upload 上传
138
138
  * @description 该组件用于上传图片场景
139
- * @tutorial https://uview-plus.jiangruyi.com/components/upload.html
139
+ * @tutorial https://uiadmin.net/uview-plus/components/upload.html
140
140
  * @property {String} accept 接受的文件类型, 可选值为all media image file video (默认 'image' )
141
141
  * @property {String | Array} capture 图片或视频拾取模式,当accept为image类型时设置capture可选额外camera可以直接调起摄像头(默认 ['album', 'camera'] )
142
142
  * @property {Boolean} compressed 当accept为video时生效,是否压缩视频,默认为true(默认 true )