uview-plus 3.8.49 → 3.8.86

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 (170) hide show
  1. package/changelog.md +2043 -1827
  2. package/components/u-action-sheet/props.js +3 -1
  3. package/components/u-action-sheet/u-action-sheet.vue +1 -0
  4. package/components/u-album/props.js +3 -1
  5. package/components/u-alert/props.js +4 -2
  6. package/components/u-avatar/props.js +4 -1
  7. package/components/u-avatar-group/props.js +4 -1
  8. package/components/u-back-top/props.js +4 -1
  9. package/components/u-badge/props.js +4 -1
  10. package/components/u-barcode/u-barcode.vue +46 -15
  11. package/components/u-box/props.js +5 -2
  12. package/components/u-button/props.js +4 -1
  13. package/components/u-button/vue.scss +3 -3
  14. package/components/u-calendar/calendar.js +14 -2
  15. package/components/u-calendar/month.vue +41 -6
  16. package/components/u-calendar/props.js +63 -1
  17. package/components/u-calendar/u-calendar.vue +311 -2
  18. package/components/u-calendar-strip/props.js +3 -1
  19. package/components/u-canvas/u-canvas.vue +734 -423
  20. package/components/u-car-keyboard/props.js +3 -1
  21. package/components/u-card/props.js +3 -1
  22. package/components/u-cell/props.js +4 -1
  23. package/components/u-cell/u-cell.vue +1 -1
  24. package/components/u-cell-group/props.js +4 -1
  25. package/components/u-checkbox/props.js +4 -1
  26. package/components/u-checkbox/u-checkbox.vue +7 -3
  27. package/components/u-checkbox-group/props.js +3 -1
  28. package/components/u-circle-progress/props.js +4 -1
  29. package/components/u-code/props.js +4 -1
  30. package/components/u-code-input/props.js +4 -1
  31. package/components/u-col/props.js +4 -1
  32. package/components/u-collapse/props.js +4 -1
  33. package/components/u-collapse-item/props.js +4 -1
  34. package/components/u-color-picker/u-color-picker.vue +1 -0
  35. package/components/u-column-notice/props.js +4 -1
  36. package/components/u-count-down/props.js +4 -1
  37. package/components/u-count-to/props.js +4 -1
  38. package/components/u-cropper/u-cropper.vue +95 -51
  39. package/components/u-datetime-picker/props.js +4 -1
  40. package/components/u-divider/props.js +4 -1
  41. package/components/u-dragsort/u-dragsort.vue +2 -1
  42. package/components/u-dropdown/props.js +3 -1
  43. package/components/u-dropdown-item/props.js +3 -1
  44. package/components/u-empty/props.js +4 -1
  45. package/components/u-form/props.js +4 -1
  46. package/components/u-form-item/props.js +4 -1
  47. package/components/u-gap/props.js +4 -1
  48. package/components/u-grid/props.js +4 -1
  49. package/components/u-grid-item/props.js +4 -1
  50. package/components/u-guide/props.js +3 -1
  51. package/components/u-icon/props.js +4 -1
  52. package/components/u-icon/u-icon.vue +2 -2
  53. package/components/u-icon/upicon.ttf +0 -0
  54. package/components/u-icon/util.js +29 -7
  55. package/components/u-image/props.js +4 -1
  56. package/components/u-image/u-image.vue +280 -267
  57. package/components/u-index-anchor/props.js +4 -1
  58. package/components/u-index-item/props.js +2 -1
  59. package/components/u-index-list/props.js +4 -1
  60. package/components/u-input/props.js +3 -1
  61. package/components/u-input/u-input.vue +10 -1
  62. package/components/u-keyboard/props.js +4 -1
  63. package/components/u-line/props.js +4 -1
  64. package/components/u-line-progress/props.js +6 -3
  65. package/components/u-link/props.js +4 -1
  66. package/components/u-list/props.js +4 -1
  67. package/components/u-list-item/props.js +4 -1
  68. package/components/u-loading-icon/props.js +4 -1
  69. package/components/u-loading-page/props.js +3 -1
  70. package/components/u-loadmore/props.js +4 -1
  71. package/components/u-markdown/u-markdown.vue +45 -3
  72. package/components/u-modal/props.js +4 -1
  73. package/components/u-navbar/props.js +4 -2
  74. package/components/u-navbar/u-navbar.vue +15 -9
  75. package/components/u-no-network/props.js +4 -1
  76. package/components/u-notice-bar/props.js +4 -1
  77. package/components/u-notify/props.js +4 -1
  78. package/components/u-number-box/props.js +4 -1
  79. package/components/u-number-box/u-number-box.vue +2 -2
  80. package/components/u-number-keyboard/props.js +4 -1
  81. package/components/u-overlay/props.js +4 -1
  82. package/components/u-pagination/u-pagination.vue +60 -39
  83. package/components/u-parse/props.js +4 -1
  84. package/components/u-picker/props.js +4 -1
  85. package/components/u-picker/u-picker.vue +15 -0
  86. package/components/u-picker-column/props.js +3 -1
  87. package/components/u-popover/props.js +2 -1
  88. package/components/u-popup/props.js +4 -1
  89. package/components/u-poster/u-poster.vue +29 -14
  90. package/components/u-qrcode/qrcode.js +88 -87
  91. package/components/u-qrcode/u-qrcode.vue +138 -256
  92. package/components/u-radio/props.js +4 -1
  93. package/components/u-radio/u-radio.vue +7 -3
  94. package/components/u-radio-group/props.js +4 -1
  95. package/components/u-rate/props.js +4 -1
  96. package/components/u-read-more/props.js +4 -1
  97. package/components/u-row/props.js +4 -1
  98. package/components/u-row-notice/props.js +4 -1
  99. package/components/u-safe-bottom/props.js +2 -1
  100. package/components/u-scroll-list/props.js +4 -1
  101. package/components/u-search/props.js +3 -1
  102. package/components/u-skeleton/props.js +4 -1
  103. package/components/u-slider/props.js +3 -1
  104. package/components/u-slider/u-slider.vue +70 -28
  105. package/components/u-status-bar/props.js +4 -1
  106. package/components/u-steps/props.js +4 -1
  107. package/components/u-steps-item/props.js +4 -1
  108. package/components/u-sticky/props.js +4 -1
  109. package/components/u-sticky/u-sticky.vue +11 -0
  110. package/components/u-subsection/props.js +3 -1
  111. package/components/u-swipe-action/props.js +4 -1
  112. package/components/u-swipe-action-item/props.js +4 -1
  113. package/components/u-swipe-action-item/u-swipe-action-item.vue +14 -0
  114. package/components/u-swiper/props.js +9 -1
  115. package/components/u-swiper/swiper.js +1 -0
  116. package/components/u-swiper/u-swiper.vue +2 -0
  117. package/components/u-swiper-indicator/props.js +4 -1
  118. package/components/u-switch/props.js +4 -1
  119. package/components/u-tabbar/props.js +3 -1
  120. package/components/u-tabbar-item/props.js +4 -1
  121. package/components/u-table/props.js +3 -1
  122. package/components/u-table2/tableRow.vue +155 -69
  123. package/components/u-table2/u-table2.vue +328 -140
  124. package/components/u-tabs/props.js +4 -1
  125. package/components/u-tabs-item/props.js +3 -1
  126. package/components/u-tag/props.js +4 -1
  127. package/components/u-td/props.js +3 -1
  128. package/components/u-text/props.js +4 -1
  129. package/components/u-textarea/props.js +3 -1
  130. package/components/u-textarea/u-textarea.vue +16 -5
  131. package/components/u-th/props.js +3 -1
  132. package/components/u-toolbar/props.js +4 -1
  133. package/components/u-tooltip/props.js +10 -2
  134. package/components/u-tooltip/tooltip.js +2 -1
  135. package/components/u-tooltip/u-tooltip.vue +31 -3
  136. package/components/u-tr/props.js +3 -1
  137. package/components/u-transition/nvue-ani-map.js +75 -68
  138. package/components/u-transition/props.js +4 -1
  139. package/components/u-transition/transitionMixin.js +164 -163
  140. package/components/u-upload/props.js +4 -1
  141. package/components/u-upload/u-upload.vue +47 -40
  142. package/components/u-waterfall/u-waterfall.vue +50 -51
  143. package/index.js +65 -8
  144. package/libs/config/props.js +179 -204
  145. package/libs/css/components.scss +3 -0
  146. package/libs/function/uni-api-shims.js +29 -0
  147. package/libs/i18n/index.js +71 -36
  148. package/libs/i18n/locale-packs.js +11 -0
  149. package/libs/i18n/locales/all.js +23 -0
  150. package/libs/i18n/locales/{de.json → de.js} +1 -1
  151. package/libs/i18n/locales/{en.json → en.js} +2 -2
  152. package/libs/i18n/locales/{es.json → es.js} +1 -1
  153. package/libs/i18n/locales/{fr.json → fr.js} +2 -2
  154. package/libs/i18n/locales/{ja.json → ja.js} +1 -1
  155. package/libs/i18n/locales/{ko.json → ko.js} +1 -1
  156. package/libs/i18n/locales/{ru.json → ru.js} +1 -1
  157. package/libs/i18n/locales/{th.json → th.js} +1 -1
  158. package/libs/i18n/locales/{zh-Hans.json → zh-Hans.js} +1 -1
  159. package/libs/i18n/locales/{zh-Hant.json → zh-Hant.js} +1 -1
  160. package/libs/mixin/mixin.js +14 -4
  161. package/libs/util/gcanvas/bridge/bridge-weex.js +10 -5
  162. package/package.json +4 -5
  163. package/tsconfig.json +18 -0
  164. package/types/comps/calendar.d.ts +57 -0
  165. package/types/comps/checkbox.d.ts +12 -0
  166. package/types/comps/lineProgress.d.ts +5 -0
  167. package/types/comps/navbar.d.ts +3 -3
  168. package/types/comps/swiper.d.ts +5 -0
  169. package/types/comps/tooltip.d.ts +36 -1
  170. /package/components/u-markdown/{marked.esm.js → marked.esm.mjs} +0 -0
@@ -4,36 +4,20 @@
4
4
  :style="{
5
5
  width: useRootHeightAndWidth ? '100%' : 'auto',
6
6
  height: useRootHeightAndWidth ? '100%' : 'auto',
7
- }"
8
- @longpress="longpress">
9
- <view class="u-qrcode__content" @click="preview">
10
- <!-- #ifdef MP || H5 -->
11
- <canvas
12
- class="u-qrcode__canvas"
13
- :id="cid"
14
- :canvas-id="cid"
15
- type="2d"
16
- :style="{ width: sizeLocal + unit, height: sizeLocal + unit }" />
17
- <!-- #endif -->
18
-
19
- <!-- #ifdef APP-PLUS -->
20
- <canvas
21
- class="u-qrcode__canvas"
22
- :id="cid"
23
- :canvas-id="cid"
24
- :style="{ width: sizeLocal + unit, height: sizeLocal + unit }" />
25
- <!-- #endif -->
26
-
27
- <!-- #ifdef APP-NVUE -->
28
- <web-view v-if="icon != ''" ref="web" src="/static/app-plus/up-canvas/local.html"
29
- :style="'width:' + sizeLocal + 'px;height:' + sizeLocal + 'px'"
30
- @onPostMessage="_onMessage" />
31
- <gcanvas v-else class="u-qrcode__canvas" ref="gcanvess"
32
- :style="{ width: sizeLocal + unit, height: sizeLocal + unit }">
33
- </gcanvas>
34
- <!-- #endif -->
35
- <view v-if="showLoading && loading" class="u-qrcode__loading"
36
- :style="{ width: sizeLocal + unit, height: sizeLocal + unit }">
7
+ }"
8
+ @longpress="longpress">
9
+ <view class="u-qrcode__content" @click="preview">
10
+ <up-canvas
11
+ ref="qrcodeCanvas"
12
+ class="u-qrcode__canvas"
13
+ :canvas-id="cid"
14
+ :width="sizeLocal"
15
+ :height="sizeLocal"
16
+ :unit="unit"
17
+ bg-color="transparent"
18
+ :style="{ width: sizeLocal + unit, height: sizeLocal + unit }" />
19
+ <view v-if="showLoading && loading" class="u-qrcode__loading"
20
+ :style="{ width: sizeLocal + unit, height: sizeLocal + unit }">
37
21
  <up-loading-icon vertical :text="loadingText" textSize="14px"></up-loading-icon>
38
22
  </view>
39
23
  </view>
@@ -41,22 +25,10 @@
41
25
  </view>
42
26
  </template>
43
27
 
44
- <script>
45
- import QRCode from "./qrcode.js"
46
- import { sleep } from '../../libs/function/index';
47
- // #ifdef APP-NVUE
48
- // https://github.com/dcloudio/NvueCanvasDemo/blob/master/README.md
49
- import {
50
- enable,
51
- WeexBridge,
52
- Image as GImage
53
- } from '../../libs/util/gcanvas/index.js';
54
- import { nextTick } from "vue";
55
- // #endif
56
- let qrcode
57
- // 20260201不能在data中存储canvas,否则会导致在微信小程序getContext获取不到canvas对象报错Cannot read property 'type'
58
- let canvas = null
59
- export default {
28
+ <script>
29
+ import QRCode from "./qrcode.js"
30
+ let qrcode
31
+ export default {
60
32
  name: "u-qrcode",
61
33
  props: {
62
34
  cid: {
@@ -149,34 +121,26 @@ export default {
149
121
  {
150
122
  name: '保存二维码',
151
123
  }
152
- ],
153
- rootId: `rootId${Number(Math.random() * 100).toFixed(0)}`,
154
- ganvas: null,
155
- canvasObj: {},
156
- sizeLocal: this.size,
157
- ctx: null,
158
- _ready: false
159
- }
160
- },
161
- async mounted(){
162
- // 如果使用根节点的宽高 则 重新设置 size
163
- if(this.useRootHeightAndWidth){
164
- await this.setNewSize()
165
- }
166
- canvas = await this.getCanvasNode(this.cid)
167
-
168
- if (!canvas) return
169
- // #ifdef MP
170
- // 不清楚是小程序的bug还是什么原因,canvas的node节点宽高和设置的宽高不一致 重新设置下
171
- canvas.width = this.sizeLocal
172
- canvas.height = this.sizeLocal
173
- // #endif
174
- // #ifdef APP-PLUS-NVUE
175
- this.isNvue = true
176
- // #endif
177
- this.ctx = this.getUPCanvasContext('2d')
178
-
179
- if (this.loadMake) {
124
+ ],
125
+ rootId: `rootId${Number(Math.random() * 100).toFixed(0)}`,
126
+ canvasObj: {},
127
+ sizeLocal: this.size,
128
+ ctx: null,
129
+ isNvue: false,
130
+ canvasHost: null
131
+ }
132
+ },
133
+ async mounted(){
134
+ // 如果使用根节点的宽高 则 重新设置 size
135
+ if(this.useRootHeightAndWidth){
136
+ await this.setNewSize()
137
+ }
138
+ // #ifdef APP-NVUE
139
+ this.isNvue = true
140
+ // #endif
141
+ await this.initCanvas()
142
+
143
+ if (this.loadMake) {
180
144
  if (!this._empty(this.val)) {
181
145
  setTimeout(() => {
182
146
  setTimeout(()=>{
@@ -185,56 +149,43 @@ export default {
185
149
  }, 0);
186
150
  }
187
151
  }
188
- },
189
- methods: {
190
- _onMessage(e) {
191
- // console.log('post message', e)
192
- const message = e.detail.data[0]
193
- switch (message.action) {
194
- // web-view 初始化完毕
195
- case 'onJSBridgeReady':
196
- this._ready = true
197
- this.$refs.web.evalJs('setContent('+JSON.stringify(this.$props) +')')
198
- break
199
- // qrcodeOk
200
- case 'qrcodeOk':
201
- this._result(message.imageData)
202
- // this.$emit('load')
203
- break
204
- }
205
- },
206
- _makeCode() {
207
- let that = this
208
- if (!canvas) return
209
- if (!this._empty(this.val)) {
152
+ },
153
+ methods: {
154
+ async _makeCode() {
155
+ let that = this
156
+ if (!this.ctx) {
157
+ await this.initCanvas(true)
158
+ }
159
+ if (!this.ctx) return
160
+ if (!this._empty(this.val)) {
210
161
  // #ifndef APP-NVUE
211
162
  this.loading = true
212
163
  // #endif
213
- // nvue下时因为gcanvas的GImage不生效,因此icon模式会采用webview
214
- if ((this.icon == '' && that.isNvue) || !that.isNvue) {
215
- qrcode = new QRCode({
216
- vuectx: that, // 上下文环境
217
- canvasId: that.cid, // canvas-id
218
- ctx: that.ctx,
219
- isNvue: that.isNvue,
220
- usingComponents: that.usingComponents, // 是否是自定义组件
221
- showLoading: false, // 是否显示loading
222
- loadingText: that.loadingText, // loading文字
223
- text: that.val, // 生成内容
224
- size: that.sizeLocal, // 二维码大小
225
- background: that.background, // 背景色
226
- foreground: that.foreground, // 前景色
227
- pdground: that.pdground, // 定位角点颜色
228
- quietZone: that.quietZone, // 静区宽度
229
- correctLevel: that.lv, // 容错级别
230
- image: that.icon, // 二维码图标
231
- imageSize: that.iconSize,// 二维码图标大小
232
- cbResult: function (res) { // 生成二维码的回调
233
- that._result(res)
234
- },
235
- });
236
- }
237
- } else {
164
+ qrcode = new QRCode({
165
+ vuectx: that, // 上下文环境
166
+ canvasId: that.cid, // canvas-id
167
+ ctx: that.ctx,
168
+ canvasHost: that.canvasHost,
169
+ isNvue: that.isNvue,
170
+ usingComponents: that.usingComponents, // 是否是自定义组件
171
+ showLoading: false, // 是否显示loading
172
+ loadingText: that.loadingText, // loading文字
173
+ text: that.val, // 生成内容
174
+ size: that.sizeLocal, // 二维码大小
175
+ width: that.sizeLocal,
176
+ height: that.sizeLocal,
177
+ background: that.background, // 背景色
178
+ foreground: that.foreground, // 前景色
179
+ pdground: that.pdground, // 定位角点颜色
180
+ quietZone: that.quietZone, // 静区宽度
181
+ correctLevel: that.lv, // 容错级别
182
+ image: that.icon, // 二维码图标
183
+ imageSize: that.iconSize,// 二维码图标大小
184
+ cbResult: function (res) { // 生成二维码的回调
185
+ that._result(res)
186
+ },
187
+ });
188
+ } else {
238
189
  uni.showToast({
239
190
  title: '二维码内容不能为空',
240
191
  icon: 'none',
@@ -242,10 +193,10 @@ export default {
242
193
  });
243
194
  }
244
195
  },
245
- _clearCode() {
246
- this._result('')
247
- qrcode.clear()
248
- },
196
+ _clearCode() {
197
+ this._result('')
198
+ if (qrcode) qrcode.clear()
199
+ },
249
200
  _saveCode() {
250
201
  let that = this;
251
202
  if (this.result != "") {
@@ -305,42 +256,25 @@ export default {
305
256
  url: this.result
306
257
  }, e)
307
258
  },
308
- async toTempFilePath({success, fail}) {
309
- if (this.ct) {
310
- this.ctx.toTempFilePath(
311
- 0,
312
- 0,
313
- this.sizeLocal,
314
- this.sizeLocal,
315
- this.sizeLocal,
316
- this.sizeLocal,
317
- "",
318
- 1,
319
- res => {
320
- success(res)
321
- }
322
- );
323
- }
324
- else {
325
- // #ifdef H5
326
- success({
327
- tempFilePath: this.ctx.canvas.toDataURL("image/png", 1)
328
- })
329
- // #endif
330
-
331
- // #ifndef H5
332
- uni.canvasToTempFilePath(
333
- {
334
- canvasId: this.cid,
335
- success :res => {
336
- success(res)
337
- },
338
- fail: fail
339
- },
340
- this)
341
- // #endif
342
- }
343
- },
259
+ async toTempFilePath({success, fail}) {
260
+ if (!this.canvasHost) {
261
+ await this.initCanvas(true)
262
+ }
263
+ if (!this.canvasHost) {
264
+ if (fail) fail(new Error('无法获取二维码画布实例'))
265
+ return
266
+ }
267
+ this.canvasHost.toTempFilePath({
268
+ width: this.sizeLocal,
269
+ height: this.sizeLocal,
270
+ destWidth: this.sizeLocal,
271
+ destHeight: this.sizeLocal,
272
+ success,
273
+ fail
274
+ }).catch(err => {
275
+ if (fail) fail(err)
276
+ })
277
+ },
344
278
  async longpress() {
345
279
  this.toTempFilePath({
346
280
  success: res => {
@@ -355,9 +289,10 @@ export default {
355
289
  * 使用根节点宽高 设置新的size
356
290
  * @return {Promise<void>}
357
291
  */
358
- async setNewSize(){
359
- const rootNode = await this.getCanvasNode(this.rootId, false);
360
- const { width , height } = rootNode;
292
+ async setNewSize(){
293
+ const rootNode = await this.getRootNode();
294
+ if (!rootNode) return
295
+ const { width , height } = rootNode;
361
296
  // 将最短的设置为二维码 的size
362
297
  if(width > height){
363
298
  this.sizeLocal = height
@@ -367,98 +302,45 @@ export default {
367
302
  }
368
303
  },
369
304
 
370
- /**
371
- * 获取节点
372
- * @param id 节点id
373
- * @param isCanvas 是否为Canvas节点
374
- * @return {Promise<unknown>}
375
- */
376
- async getCanvasNode(id, isCanvas = true) {
377
- let that = this
378
- return new Promise((resolve, reject) => {
379
- try {
380
- // #ifdef APP-NVUE
381
- setTimeout(() => {
382
- /*获取元素引用*/
383
- this.ganvas = this.$refs["gcanvess"]
384
- /*通过元素引用获取canvas对象*/
385
- let canvasNode = enable(this.ganvas, {
386
- bridge: WeexBridge
387
- })
388
- resolve(canvasNode)
389
- }, 200)
390
- // #endif
391
- // #ifndef APP-PLUS-NVUE
392
- const query = uni.createSelectorQuery().in(that).select(`#${id}`);
393
- query.fields({
394
- node: true,
395
- size: true
396
- })
397
- .exec((res) => {
398
- if (isCanvas) {
399
- if (res[0]?.node) {
400
- resolve(res[0].node)
401
- } else {
402
- resolve(false)
403
- console.error("获取节点出错", res)
404
- }
405
- } else {
406
- resolve(res[0])
407
- }
408
- })
409
- // #endif
410
- } catch (e) {
411
- console.error("获取节点失败", e)
412
- }
413
- })
414
- },
415
- getUPCanvasContext() {
416
- // #ifdef APP-PLUS
417
- return uni.createCanvasContext(this.cid, this);
418
- // #endif
419
- // #ifdef APP-PLUS-NVUE || MP || H5
420
- return canvas.getContext('2d');
421
- // #endif
422
- },
423
- drawImage(url, x, y, w, h) {
424
- try {
425
- let img = {}
426
- // #ifdef APP-NVUE
427
- img = new GImage();
428
- // #endif
429
-
430
- // #ifdef H5
431
- // APP下不支持会一直卡住
432
- img = new Image();
433
- // #endif
434
-
435
- // #ifdef MP
436
- // 小程序2d
437
- // https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.createImage.html
438
- img = canvas.createImage();
439
- // #endif
440
- // #ifdef APP-NVUE
441
- let that = this
442
- // console.log(img)
443
- img.onload = function(){
444
- if (process.env.NODE_ENV === 'development') {
445
- console.log('drawImage绘制2...')
446
- }
447
- that.cxt.drawImage(img, x, y, w, h);
448
- }
449
- // #endif
450
- // #ifdef H5 || MP
451
- img.onload = () => {
452
- this.ctx.drawImage(img, x, y, w, h);
453
- };
454
- // #endif
455
- img.src = url;
456
- // #ifdef APP-VUE
457
- this.ctx.drawImage(url, x, y, w, h);
458
- // #endif
459
- } catch (error) {
460
- console.log('drawImage绘制出错', error)
461
- }
305
+ async getRootNode() {
306
+ return new Promise((resolve, reject) => {
307
+ try {
308
+ const query = uni.createSelectorQuery().in(this).select(`#${this.rootId}`);
309
+ query.fields({
310
+ size: true
311
+ })
312
+ .exec((res) => {
313
+ resolve(res[0] || false)
314
+ })
315
+ } catch (e) {
316
+ console.error("获取二维码根节点失败", e)
317
+ resolve(false)
318
+ }
319
+ })
320
+ },
321
+ async initCanvas(force = false) {
322
+ await this.$nextTick()
323
+ const canvasRef = this.$refs.qrcodeCanvas
324
+ if (!canvasRef) return false
325
+ await canvasRef.initCanvas(force)
326
+ this.canvasHost = canvasRef
327
+ this.ctx = canvasRef.getRawContext()
328
+ return !!this.ctx
329
+ },
330
+ getUPCanvasContext() {
331
+ return this.canvasHost ? this.canvasHost.getRawContext() : null
332
+ },
333
+ async drawImage(url, x, y, w, h) {
334
+ try {
335
+ if (!this.canvasHost) {
336
+ await this.initCanvas(true)
337
+ }
338
+ if (this.canvasHost) {
339
+ await this.canvasHost.drawImage(url, x, y, w, h)
340
+ }
341
+ } catch (error) {
342
+ console.log('drawImage绘制出错', error)
343
+ }
462
344
  },
463
345
 
464
346
  selectClick(index) {
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import RadioDefaultProps from './radio'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(RadioDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // radio的名称
@@ -11,7 +11,7 @@
11
11
  :class="iconClasses"
12
12
  :style="[iconWrapStyle]"
13
13
  >
14
- <slot name="icon" :elIconSize="elIconSize" :elIconColor="elIconColor">
14
+ <slot name="icon" :elIconSize="elIconSize" :elIconColor="elIconColor" :checked="checked" :elDisabled="elDisabled">
15
15
  <up-icon
16
16
  class="u-radio__icon-wrap__icon"
17
17
  name="checkbox-mark"
@@ -145,8 +145,12 @@
145
145
  if (this.elDisabled) {
146
146
  classes.push('u-radio__icon-wrap--disabled')
147
147
  }
148
- if (this.checked && this.elDisabled) {
149
- classes.push('u-radio__icon-wrap--disabled--checked')
148
+ if (this.checked) {
149
+ if (this.elDisabled) {
150
+ classes.push('u-radio__icon-wrap--disabled--checked')
151
+ } else {
152
+ classes.push('u-radio__icon-wrap--checked')
153
+ }
150
154
  }
151
155
  // 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效
152
156
  // #ifdef MP-ALIPAY || MP-TOUTIAO
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import RadioGroupDefaultProps from './radioGroup'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(RadioGroupDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // #ifdef VUE3
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import RateDefaultProps from './rate'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(RateDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // #ifdef VUE3
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import ReadMoreDefaultProps from './readMore'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(ReadMoreDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // 默认的显示占位高度
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import RowDefaultProps from './row'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(RowDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // 给col添加间距,左右边距各占一半
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import RowNoticeDefaultProps from './rowNotice'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(RowNoticeDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // 显示的内容,字符串
@@ -1,6 +1,7 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import { registerComponentProps } from '../../libs/config/props.js'
3
3
 
4
+ const defProps = registerComponentProps({ safeBottom: {} })
4
5
  export const props = defineMixin({
5
6
  props: {
6
7
  }
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import ScrollListDefaultProps from './scrollList'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(ScrollListDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // 指示器的整体宽度
@@ -1,6 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import SearchDefaultProps from './search'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
3
4
 
5
+ const defProps = registerComponentProps(SearchDefaultProps)
4
6
  export const props = defineMixin({
5
7
  props: {
6
8
  // #ifdef VUE3
@@ -1,5 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import SkeletonDefaultProps from './skeleton'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
4
+
5
+ const defProps = registerComponentProps(SkeletonDefaultProps)
3
6
  export const props = defineMixin({
4
7
  props: {
5
8
  // 是否展示骨架组件
@@ -1,6 +1,8 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
- import defProps from '../../libs/config/props.js'
2
+ import SliderDefaultProps from './slider'
3
+ import { registerComponentProps } from '../../libs/config/props.js'
3
4
 
5
+ const defProps = registerComponentProps(SliderDefaultProps)
4
6
  export const props = defineMixin({
5
7
  props: {
6
8
  // 最小可选值