uview-plus 3.8.55 → 3.8.106

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 (229) hide show
  1. package/changelog.md +2147 -1828
  2. package/components/u-action-sheet/props.js +3 -1
  3. package/components/u-action-sheet/u-action-sheet.vue +22 -2
  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 +44 -15
  11. package/components/u-box/props.js +5 -2
  12. package/components/u-button/props.js +4 -1
  13. package/components/u-button/u-button.vue +2 -5
  14. package/components/u-button/vue.scss +3 -3
  15. package/components/u-calendar/calendar.js +8 -0
  16. package/components/u-calendar/props.js +43 -1
  17. package/components/u-calendar/u-calendar.vue +16 -0
  18. package/components/u-calendar-strip/props.js +3 -1
  19. package/components/u-canvas/u-canvas.vue +1028 -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 +9 -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-datetime-picker/u-datetime-picker.vue +53 -4
  41. package/components/u-divider/props.js +4 -1
  42. package/components/u-dragsort/u-dragsort.vue +57 -32
  43. package/components/u-dropdown/props.js +3 -1
  44. package/components/u-dropdown-item/props.js +3 -1
  45. package/components/u-empty/props.js +4 -1
  46. package/components/u-form/props.js +4 -1
  47. package/components/u-form-item/props.js +4 -1
  48. package/components/u-gap/props.js +4 -1
  49. package/components/u-grid/props.js +4 -1
  50. package/components/u-grid-item/props.js +4 -1
  51. package/components/u-guide/props.js +3 -1
  52. package/components/u-icon/props.js +4 -1
  53. package/components/u-icon/u-icon.vue +11 -2
  54. package/components/u-icon/upicon.ttf +0 -0
  55. package/components/u-icon/util.js +103 -10
  56. package/components/u-image/props.js +4 -1
  57. package/components/u-image/u-image.vue +280 -267
  58. package/components/u-index-anchor/props.js +4 -1
  59. package/components/u-index-item/props.js +2 -1
  60. package/components/u-index-item/u-index-item.vue +1 -1
  61. package/components/u-index-list/props.js +4 -1
  62. package/components/u-index-list/u-index-list.vue +1 -1
  63. package/components/u-input/props.js +3 -1
  64. package/components/u-keyboard/props.js +4 -1
  65. package/components/u-line/props.js +4 -1
  66. package/components/u-line-progress/props.js +6 -3
  67. package/components/u-link/props.js +4 -1
  68. package/components/u-list/props.js +4 -1
  69. package/components/u-list-item/props.js +4 -1
  70. package/components/u-loading-icon/props.js +4 -1
  71. package/components/u-loading-page/props.js +3 -1
  72. package/components/u-loadmore/props.js +4 -1
  73. package/components/u-markdown/u-markdown.vue +45 -3
  74. package/components/u-modal/props.js +4 -1
  75. package/components/u-navbar/props.js +4 -2
  76. package/components/u-navbar/u-navbar.vue +15 -9
  77. package/components/u-no-network/props.js +4 -1
  78. package/components/u-notice-bar/props.js +4 -1
  79. package/components/u-notify/props.js +4 -1
  80. package/components/u-novel-reader/content-normalizer.js +80 -0
  81. package/components/u-novel-reader/layout-engine.js +225 -0
  82. package/components/u-novel-reader/measure-adapter.js +69 -0
  83. package/components/u-novel-reader/novelReader.js +35 -0
  84. package/components/u-novel-reader/persistence.js +144 -0
  85. package/components/u-novel-reader/props.js +100 -0
  86. package/components/u-novel-reader/reader-catalog.vue +234 -0
  87. package/components/u-novel-reader/reader-content.vue +226 -0
  88. package/components/u-novel-reader/reader-core.js +151 -0
  89. package/components/u-novel-reader/reader-settings.vue +325 -0
  90. package/components/u-novel-reader/reader-toolbar.vue +313 -0
  91. package/components/u-novel-reader/theme-vars.scss +49 -0
  92. package/components/u-novel-reader/u-novel-reader.vue +836 -0
  93. package/components/u-number-box/props.js +4 -1
  94. package/components/u-number-box/u-number-box.vue +2 -2
  95. package/components/u-number-keyboard/props.js +4 -1
  96. package/components/u-overlay/props.js +4 -1
  97. package/components/u-pagination/u-pagination.vue +60 -39
  98. package/components/u-parse/props.js +4 -1
  99. package/components/u-picker/props.js +4 -1
  100. package/components/u-picker-column/props.js +3 -1
  101. package/components/u-popover/props.js +2 -1
  102. package/components/u-popup/props.js +4 -1
  103. package/components/u-poster/u-poster.vue +246 -214
  104. package/components/u-qrcode/qrcode.js +105 -97
  105. package/components/u-qrcode/u-qrcode.vue +242 -289
  106. package/components/u-radio/props.js +4 -1
  107. package/components/u-radio/u-radio.vue +7 -3
  108. package/components/u-radio-group/props.js +4 -1
  109. package/components/u-rate/props.js +4 -1
  110. package/components/u-read-more/props.js +4 -1
  111. package/components/u-row/props.js +4 -1
  112. package/components/u-row-notice/props.js +4 -1
  113. package/components/u-safe-bottom/props.js +2 -1
  114. package/components/u-scroll-list/props.js +4 -1
  115. package/components/u-scroll-list/scrollWxs.wxs +1 -1
  116. package/components/u-search/props.js +3 -1
  117. package/components/u-skeleton/props.js +4 -1
  118. package/components/u-slider/props.js +3 -1
  119. package/components/u-slider/u-slider.vue +71 -29
  120. package/components/u-status-bar/props.js +4 -1
  121. package/components/u-steps/props.js +4 -1
  122. package/components/u-steps-item/props.js +4 -1
  123. package/components/u-sticky/props.js +4 -1
  124. package/components/u-sticky/u-sticky.vue +11 -0
  125. package/components/u-subsection/props.js +3 -1
  126. package/components/u-swipe-action/props.js +4 -1
  127. package/components/u-swipe-action-item/index.wxs +43 -25
  128. package/components/u-swipe-action-item/nvue.js +9 -0
  129. package/components/u-swipe-action-item/other.js +32 -21
  130. package/components/u-swipe-action-item/props.js +9 -1
  131. package/components/u-swipe-action-item/swipeActionItem.js +1 -0
  132. package/components/u-swipe-action-item/u-swipe-action-item.vue +42 -4
  133. package/components/u-swiper/props.js +9 -1
  134. package/components/u-swiper/swiper.js +1 -0
  135. package/components/u-swiper/u-swiper.vue +2 -0
  136. package/components/u-swiper-indicator/props.js +4 -1
  137. package/components/u-switch/props.js +4 -1
  138. package/components/u-switch/u-switch.vue +1 -1
  139. package/components/u-tabbar/props.js +3 -1
  140. package/components/u-tabbar/u-tabbar.vue +2 -1
  141. package/components/u-tabbar-item/props.js +4 -1
  142. package/components/u-tabbar-item/u-tabbar-item.vue +64 -21
  143. package/components/u-table/props.js +3 -1
  144. package/components/u-table2/tableRow.vue +155 -69
  145. package/components/u-table2/u-table2.vue +327 -137
  146. package/components/u-tabs/props.js +4 -1
  147. package/components/u-tabs/u-tabs.vue +11 -8
  148. package/components/u-tabs-item/props.js +3 -1
  149. package/components/u-tabs-pro/u-tabs-pro.vue +212 -0
  150. package/components/u-tag/props.js +4 -1
  151. package/components/u-td/props.js +3 -1
  152. package/components/u-text/props.js +4 -1
  153. package/components/u-text/text.js +1 -1
  154. package/components/u-text/u-text.vue +18 -6
  155. package/components/u-textarea/props.js +3 -1
  156. package/components/u-textarea/u-textarea.vue +16 -5
  157. package/components/u-th/props.js +3 -1
  158. package/components/u-toolbar/props.js +4 -1
  159. package/components/u-tooltip/props.js +10 -2
  160. package/components/u-tooltip/tooltip.js +2 -1
  161. package/components/u-tooltip/u-tooltip.vue +31 -3
  162. package/components/u-tr/props.js +3 -1
  163. package/components/u-transition/nvue-ani-map.js +75 -68
  164. package/components/u-transition/props.js +4 -1
  165. package/components/u-transition/transitionMixin.js +164 -163
  166. package/components/u-upload/props.js +4 -1
  167. package/components/u-upload/u-upload.vue +48 -41
  168. package/components/u-waterfall/u-waterfall.vue +162 -110
  169. package/index.js +65 -8
  170. package/libs/config/config.js +1 -1
  171. package/libs/config/props.js +180 -204
  172. package/libs/css/components.scss +3 -0
  173. package/libs/function/index.js +66 -0
  174. package/libs/function/uni-api-shims.js +29 -0
  175. package/libs/i18n/index.js +71 -36
  176. package/libs/i18n/locale-packs.js +11 -0
  177. package/libs/i18n/locales/all.js +23 -0
  178. package/libs/i18n/locales/{de.json → de.js} +1 -1
  179. package/libs/i18n/locales/{en.json → en.js} +2 -2
  180. package/libs/i18n/locales/{es.json → es.js} +1 -1
  181. package/libs/i18n/locales/{fr.json → fr.js} +2 -2
  182. package/libs/i18n/locales/{ja.json → ja.js} +1 -1
  183. package/libs/i18n/locales/{ko.json → ko.js} +1 -1
  184. package/libs/i18n/locales/{ru.json → ru.js} +1 -1
  185. package/libs/i18n/locales/{th.json → th.js} +1 -1
  186. package/libs/i18n/locales/{zh-Hans.json → zh-Hans.js} +1 -1
  187. package/libs/i18n/locales/{zh-Hant.json → zh-Hant.js} +1 -1
  188. package/libs/mixin/mixin.js +18 -54
  189. package/libs/root/index.js +78 -5
  190. package/libs/root/page.js +7 -7
  191. package/libs/root/root.js +73 -3
  192. package/libs/util/app-nvue-webview-canvas.js +486 -0
  193. package/libs/util/gcanvas/bridge/bridge-weex.js +10 -7
  194. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  195. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  196. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  197. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  198. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  199. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  200. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  201. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  202. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  203. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  204. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  205. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  206. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  207. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  208. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  209. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  210. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  211. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  212. package/libs/util/gcanvas/env/canvas.js +0 -0
  213. package/libs/util/gcanvas/env/image.js +0 -0
  214. package/libs/util/gcanvas/env/tool.js +0 -0
  215. package/libs/util/gcanvas/index.js +3 -3
  216. package/package.json +4 -5
  217. package/tsconfig.json +18 -0
  218. package/types/comps/calendar.d.ts +38 -0
  219. package/types/comps/checkbox.d.ts +12 -0
  220. package/types/comps/lineProgress.d.ts +5 -0
  221. package/types/comps/navbar.d.ts +3 -3
  222. package/types/comps/swipeActionItem.d.ts +13 -0
  223. package/types/comps/swiper.d.ts +5 -0
  224. package/types/comps/tabs.d.ts +2 -1
  225. package/types/comps/text.d.ts +1 -1
  226. package/types/comps/tooltip.d.ts +36 -1
  227. package/types/func.d.ts +23 -0
  228. package/types/index.d.ts +1 -0
  229. /package/components/u-markdown/{marked.esm.js → marked.esm.mjs} +0 -0
@@ -92,10 +92,14 @@
92
92
  return {
93
93
  columnList: [[]], // 存储每列的数据
94
94
  children: [],
95
- // 用于标记是否已经初始化
96
- initialized: false,
97
- windowWidth: 375,
98
- windowHeight: 0
95
+ // 用于标记是否已经初始化
96
+ initialized: false,
97
+ windowWidth: 375,
98
+ windowHeight: 0,
99
+ distributionQueue: [],
100
+ distributionRunning: false,
101
+ distributionPromise: null,
102
+ distributionGeneration: 0
99
103
  }
100
104
  },
101
105
  watch: {
@@ -107,22 +111,27 @@
107
111
  if (this.columnList.length == 1) {
108
112
  this.initColumnList()
109
113
  }
110
- // 取差值,即这一次数组变化新增的部分
111
- let startIndex = Array.isArray(oVal) && oVal.length > 0 ? oVal.length : 0;
112
- // 直接处理数据,不再使用tempList和splitData
113
- this.handleData(nVal.slice(startIndex));
114
+ if (!this.isPureAppend(nVal, oVal)) {
115
+ this.redistributeData(nVal);
116
+ return;
117
+ }
118
+ // 取差值,即这一次数组变化新增的部分
119
+ const startIndex = Array.isArray(oVal) && oVal.length > 0 ? oVal.length : 0;
120
+ // 纯追加时只将新增数据加入共享分配队列
121
+ this.handleData(nVal.slice(startIndex));
114
122
  }
115
123
  },
116
124
  immediate: true
117
125
  },
118
- columns: {
119
- handler() {
120
- this.initColumnList();
121
- // 重新分配数据
122
- if (this.copyFlowList.length > 0) {
123
- this.redistributeData();
124
- }
125
- },
126
+ columns: {
127
+ handler() {
128
+ // 重新分配数据
129
+ if (this.copyFlowList.length > 0) {
130
+ this.redistributeData(this.copyFlowList);
131
+ } else {
132
+ this.clear(false);
133
+ }
134
+ },
126
135
  immediate: false
127
136
  }
128
137
  },
@@ -210,101 +219,144 @@
210
219
  const newColumnsCount = this.getColumnsCount();
211
220
  const oldColumnsCount = this.columnList.length;
212
221
 
213
- // 只有列数发生变化时才重新分配数据
214
- if (newColumnsCount !== oldColumnsCount) {
215
- this.redistributeData();
216
- }
217
- }, 300);
218
- },
219
-
220
- // 重新分配所有数据
221
- async redistributeData() {
222
- // 清空所有列
223
- this.initColumnList();
224
- // 保存所有数据
225
- const allData = this.cloneData(this.copyFlowList);
226
- // 重新分配数据
227
- this.handleData(allData);
228
- },
229
-
230
- // 处理新增数据
231
- async handleData(newData) {
232
- if (!newData || newData.length === 0) return;
233
-
234
- // 初始化列高度数组
235
- const columnHeights = new Array(this.columnList.length).fill(0);
236
-
237
- // 获取各列当前高度
238
- for (let i = 0; i < this.columnList.length; i++) {
239
- try {
240
- const rect = await this.$uGetRect(`#u-column-${i}`);
241
- // console.log(`#u-column-${i}`, rect.height)
242
- columnHeights[i] = rect.height || 0;
243
- } catch (e) {
244
- columnHeights[i] = 0;
245
- }
246
- }
247
-
248
- // 分配新数据到最短的列
249
- for (let item of newData) {
250
- const minHeightIndex = columnHeights.indexOf(Math.min(...columnHeights));
251
- // console.log('this.columnList', this.columnList)
252
- this.columnList[minHeightIndex].push(item);
253
-
254
- // 获取实际渲染后的元素高度而不是估算
255
- await sleep(this.addTime)
256
- await this.$nextTick(async () => {
257
- try {
258
- const rect = await this.$uGetRect(`#u-column-${minHeightIndex}`);
259
- // console.log(`#u-column-${minHeightIndex}`, rect.height)
260
- if (rect.height) {
261
- columnHeights[minHeightIndex] = rect.height;
262
- // 加载一个后置事件
263
- this.$emit('after-add-one', {
264
- ...item,
265
- height: rect.height
266
- });
267
- }
268
- } catch (e) {
269
- // console.log(e)
270
- // columnHeights[i] = 0;
271
- }
272
- });
273
- // this.$nextTick(async () => {
274
- // try {
275
- // // 等待DOM更新后获取实际高度
276
- // const lastIndex = this.columnList[minHeightIndex].length - 1;
277
- // const el = this.$refs[`u-column-${minHeightIndex}`][0].children[lastIndex];
278
- // if (el) {
279
- // const rect = await this.$uGetRect(el);
280
- // const actualHeight = rect.height || 100;
281
- // columnHeights[minHeightIndex] += actualHeight;
282
- // } else {
283
- // // 备用方案:如果无法获取实际高度,则使用默认值
284
- // columnHeights[minHeightIndex] += 100;
285
- // }
286
- // } catch (e) {
287
- // // 出错时使用默认高度
288
- // console.log(e)
289
- // columnHeights[minHeightIndex] += 100;
290
- // }
291
- // });
292
- }
293
- // 加载所有后置事件
294
- this.$emit('after-add-all', {
295
- columnHeights: columnHeights,
296
- newData: newData
297
- });
298
- },
299
-
300
- // 复制而不是引用对象和数组
301
- cloneData(data) {
302
- return JSON.parse(JSON.stringify(data));
222
+ // 只有列数发生变化时才重新分配数据
223
+ if (newColumnsCount !== oldColumnsCount) {
224
+ this.redistributeData(this.copyFlowList);
225
+ }
226
+ }, 300);
227
+ },
228
+
229
+ // 重新分配所有数据
230
+ redistributeData(data = this.copyFlowList) {
231
+ this.clear(false);
232
+ // 保存所有数据
233
+ const allData = this.cloneData(data || []);
234
+ // 重新分配数据
235
+ return this.handleData(allData);
236
+ },
237
+
238
+ // 判断新数据是否只在原数组末尾追加
239
+ isPureAppend(newData, oldData) {
240
+ if (!Array.isArray(oldData) || oldData.length === 0) return true;
241
+ if (!Array.isArray(newData) || newData.length < oldData.length) return false;
242
+ return oldData.every((item, index) => {
243
+ return JSON.stringify(item) === JSON.stringify(newData[index]);
244
+ });
245
+ },
246
+
247
+ // 将新增数据加入共享队列,确保只有一个分配循环运行
248
+ handleData(newData) {
249
+ if (!newData || newData.length === 0) {
250
+ return this.distributionPromise || Promise.resolve();
251
+ }
252
+ this.distributionQueue.push({
253
+ generation: this.distributionGeneration,
254
+ data: this.cloneData(newData)
255
+ });
256
+ if (!this.distributionRunning) {
257
+ this.distributionPromise = this.runDistributionQueue();
258
+ }
259
+ return this.distributionPromise;
260
+ },
261
+
262
+ // 串行消费所有待分配数据
263
+ async runDistributionQueue() {
264
+ if (this.distributionRunning) return;
265
+ this.distributionRunning = true;
266
+ try {
267
+ while (this.distributionQueue.length > 0) {
268
+ const task = this.distributionQueue.shift();
269
+ if (task.generation !== this.distributionGeneration) continue;
270
+ await this.distributeData(task.data, task.generation);
271
+ }
272
+ } finally {
273
+ this.distributionRunning = false;
274
+ this.distributionPromise = null;
275
+ if (this.distributionQueue.length > 0) {
276
+ this.distributionPromise = this.runDistributionQueue();
277
+ }
278
+ }
279
+ },
280
+
281
+ // 逐项测量并分配数据,代数变化时立即退出
282
+ async distributeData(newData, generation) {
283
+ let columnHeights = new Array(this.columnList.length).fill(0);
284
+ for (const item of newData) {
285
+ if (generation !== this.distributionGeneration) return;
286
+ columnHeights = await this.getColumnHeights();
287
+ if (generation !== this.distributionGeneration) return;
288
+
289
+ const minHeightIndex = this.getMinHeightColumnIndex(columnHeights);
290
+ this.columnList[minHeightIndex].push(item);
291
+
292
+ await sleep(this.addTime);
293
+ if (generation !== this.distributionGeneration) return;
294
+ await this.$nextTick();
295
+ if (generation !== this.distributionGeneration) return;
296
+ try {
297
+ const rect = await this.$uGetRect(`#u-column-${minHeightIndex}`);
298
+ if (generation !== this.distributionGeneration) return;
299
+ if (rect.height) {
300
+ columnHeights[minHeightIndex] = rect.height;
301
+ this.$emit('after-add-one', {
302
+ ...item,
303
+ height: rect.height
304
+ });
305
+ }
306
+ } catch (e) {
307
+ // 获取不到列高时,下一个元素会重新测量所有列
308
+ }
309
+ }
310
+ if (generation !== this.distributionGeneration) return;
311
+ this.$emit('after-add-all', {
312
+ columnHeights: columnHeights,
313
+ newData: newData
314
+ });
315
+ },
316
+
317
+ // 获取当前所有列的真实高度
318
+ async getColumnHeights() {
319
+ const columnHeights = new Array(this.columnList.length).fill(0);
320
+ for (let i = 0; i < this.columnList.length; i++) {
321
+ try {
322
+ const rect = await this.$uGetRect(`#u-column-${i}`);
323
+ columnHeights[i] = rect.height || 0;
324
+ } catch (e) {
325
+ columnHeights[i] = 0;
326
+ }
327
+ }
328
+ return columnHeights;
329
+ },
330
+
331
+ // 获取最短列;高度相同或暂不可测时按列数据量打散,避免全部落到第一列
332
+ getMinHeightColumnIndex(columnHeights) {
333
+ let minIndex = 0;
334
+ for (let i = 1; i < columnHeights.length; i++) {
335
+ const currentHeight = Number(columnHeights[i]) || 0;
336
+ const minHeight = Number(columnHeights[minIndex]) || 0;
337
+ if (currentHeight < minHeight) {
338
+ minIndex = i;
339
+ } else if (currentHeight === minHeight) {
340
+ const currentLength = this.columnList[i] ? this.columnList[i].length : 0;
341
+ const minLength = this.columnList[minIndex] ? this.columnList[minIndex].length : 0;
342
+ if (currentLength < minLength) {
343
+ minIndex = i;
344
+ }
345
+ }
346
+ }
347
+ return minIndex;
348
+ },
349
+
350
+ // 复制而不是引用对象和数组
351
+ cloneData(data) {
352
+ return JSON.parse(JSON.stringify(data));
303
353
  },
304
354
 
305
- // 清空数据列表
306
- clear(bak = true) {
307
- this.initColumnList();
355
+ // 清空数据列表
356
+ clear(bak = true) {
357
+ this.distributionGeneration += 1;
358
+ this.distributionQueue.splice(0);
359
+ this.initColumnList();
308
360
  // 同时清除父组件列表中的数据
309
361
  if (bak) {
310
362
  // #ifdef VUE2
@@ -413,4 +465,4 @@
413
465
  max-width: 100%;
414
466
  /* #endif */
415
467
  }
416
- </style>
468
+ </style>
package/index.js CHANGED
@@ -1,3 +1,7 @@
1
+ // 补齐部分平台缺失的 uni API(如支付宝小程序的 onWindowResize)
2
+ import { applyUniApiShims } from './libs/function/uni-api-shims.js'
3
+ applyUniApiShims()
4
+
1
5
  // 看到此报错,是因为没有配置vite.config.js的【transpileDependencies】
2
6
  // const pleaseSetTranspileDependencies = {}, babelTest = pleaseSetTranspileDependencies?.test
3
7
 
@@ -27,7 +31,7 @@ import index, { rpx2px } from './libs/function/index.js'
27
31
  // 配置信息
28
32
  import config from './libs/config/config.js'
29
33
  // props配置信息
30
- import props from './libs/config/props.js'
34
+ import props, { setPropsConfig } from './libs/config/props.js'
31
35
  // 各个需要fixed的地方的z-index配置文件
32
36
  import zIndex from './libs/config/zIndex.js'
33
37
  // 关于颜色的配置,特殊场景使用
@@ -42,7 +46,26 @@ import http from './libs/function/http.js'
42
46
  import fontUtil from './components/u-icon/util.js';
43
47
 
44
48
  // i18n
45
- import i18n, { t } from './libs/i18n/index.js'
49
+ import i18n, {
50
+ t,
51
+ registerLocale,
52
+ hasLocale,
53
+ getLocale,
54
+ setLocale
55
+ } from './libs/i18n/index.js'
56
+ import {
57
+ en,
58
+ es,
59
+ fr,
60
+ de,
61
+ ko,
62
+ ja,
63
+ ru,
64
+ th,
65
+ zhHans,
66
+ zhHant,
67
+ all as allLocales
68
+ } from './libs/i18n/locale-packs.js'
46
69
  import {
47
70
  themeState,
48
71
  setTheme,
@@ -135,7 +158,41 @@ function rootNotify(options = {}) {
135
158
 
136
159
  // 导出
137
160
  let themeType = ['primary', 'success', 'error', 'warning', 'info'];
138
- export { route, http, debounce, throttle, calc, digit, platform, themeType, mixin, mpMixin, props, color, test, zIndex, fontUtil, i18n , rpx2px, t}
161
+ export {
162
+ route,
163
+ http,
164
+ debounce,
165
+ throttle,
166
+ calc,
167
+ digit,
168
+ platform,
169
+ themeType,
170
+ mixin,
171
+ mpMixin,
172
+ props,
173
+ color,
174
+ test,
175
+ zIndex,
176
+ fontUtil,
177
+ i18n,
178
+ rpx2px,
179
+ t,
180
+ registerLocale,
181
+ hasLocale,
182
+ getLocale,
183
+ setLocale,
184
+ en,
185
+ es,
186
+ fr,
187
+ de,
188
+ ko,
189
+ ja,
190
+ ru,
191
+ th,
192
+ zhHans,
193
+ zhHant,
194
+ allLocales
195
+ }
139
196
  export * from './libs/function/index.js'
140
197
  export * from './libs/function/colorGradient.js'
141
198
 
@@ -149,7 +206,7 @@ export * from './libs/function/colorGradient.js'
149
206
  export function setConfig(configs) {
150
207
  const settings = configs || {}
151
208
  index.shallowMerge(config, settings.config || {})
152
- index.shallowMerge(props, settings.props || {})
209
+ setPropsConfig(settings.props || {})
153
210
  index.shallowMerge(color, settings.color || {})
154
211
  index.shallowMerge(zIndex, settings.zIndex || {})
155
212
  syncThemeColorOverrideState({
@@ -182,7 +239,7 @@ const $u = {
182
239
  calc,
183
240
  mixin,
184
241
  mpMixin,
185
- // props,
242
+ props,
186
243
  ...index,
187
244
  color,
188
245
  platform,
@@ -253,8 +310,8 @@ let components = []
253
310
  function resolveComponents() {
254
311
  if (components.length) return components
255
312
  // #ifdef H5
256
- const canUseGlob = typeof import.meta !== 'undefined' && typeof import.meta.glob === 'function'
257
- if (!canUseGlob) return components
313
+ // import.meta.glob is a Vite compile-time macro; the runtime guard would
314
+ // always fail in the browser and block component registration.
258
315
  const importFn = import.meta.glob('./components/u-*/u-*.vue', { eager: true })
259
316
  for (const key in importFn) {
260
317
  const component = importFn[key]?.default
@@ -305,4 +362,4 @@ const install = (Vue, upuiParams = '') => {
305
362
 
306
363
  export default {
307
364
  install
308
- }
365
+ }
@@ -54,5 +54,5 @@ export default {
54
54
  navbarLeftClick: null
55
55
  },
56
56
  // 只加载一次字体
57
- loadFontOnce: false
57
+ loadFontOnce: true
58
58
  }