uview-plus 3.4.62 → 3.4.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.4.64(2025-07-25)
2
+ feat: 新增dragsort拖动排序组件
3
+
4
+ ## 3.4.63(2025-07-24)
5
+ feat: count-down支持slot传递时间参数
6
+
1
7
  ## 3.4.62(2025-07-24)
2
8
  feat: divider支持默认插槽
3
9
 
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <view class="u-count-down">
3
- <slot>
3
+ <slot :days="timeData.days" :hours="timeData.hours"
4
+ :minutes="timeData.minutes" :seconds="timeData.seconds">
4
5
  <text class="u-count-down__text">{{ formattedTime }}</text>
5
6
  </slot>
6
7
  </view>
@@ -112,6 +113,7 @@
112
113
  this.remainTime = remain
113
114
  // 根据剩余的毫秒时间,得出该有天,小时,分钟等的值,返回一个对象
114
115
  const timeData = parseTimeData(remain)
116
+ this.timeData = timeData;
115
117
  this.$emit('change', timeData)
116
118
  // 得出格式化后的时间
117
119
  this.formattedTime = parseFormat(this.format, timeData)
@@ -1,372 +1,367 @@
1
1
  <template>
2
- <view class="u-dragsort" :class="direction == 'horizontal' ? 'u-dragsort--horizontal' : ''">
3
- <view
4
- v-for="(item, index) in list"
5
- :key="item.id"
6
- :id="`u-dragsort-item-${index}`"
7
- :ref="(el) => setItemRef(el, index)"
8
- class="u-dragsort-item"
9
- :class="{
10
- 'dragging': dragIndex === index,
11
- 'nearby': closestIndex === index
12
- }"
13
- :style="{
14
- transform: dragIndex === index ? `translateY(${dragY}px)` : 'none',
15
- zIndex: dragIndex === index ? 10 : 'auto'
16
- }"
17
- @touchstart="onTouchStart(index, $event)"
18
- @touchmove="onTouchMove($event)"
19
- @touchend="onTouchEnd"
20
- >
21
- <!-- 默认插槽,用户可自定义 item 渲染内容 -->
22
- <slot :item="item" :index="index">
23
- <!-- 默认内容 -->
24
- <view class="u-dragsort-item-content">
25
- {{ item.label }}
26
- </view>
27
- </slot>
2
+ <view class="u-dragsort"
3
+ :class="[direction == 'horizontal' ? 'u-dragsort--horizontal' : '', direction == 'all' ? 'u-dragsort--all' : '']">
4
+ <movable-area class="u-dragsort-area" :style="movableAreaStyle">
5
+ <movable-view v-for="(item, index) in list" :key="item.id" :id="`u-dragsort-item-${index}`"
6
+ class="u-dragsort-item" :class="{ 'dragging': dragIndex === index }"
7
+ :direction="direction === 'all' ? 'all' : direction" :x="item.x" :y="item.y" :inertia="false"
8
+ :disabled="!draggable || (item.draggable === false)" @change="onChange(index, $event)"
9
+ @touchstart="onTouchStart(index)" @touchend="onTouchEnd" @touchcancel="onTouchEnd">
10
+ <view class="u-dragsort-item-content">
11
+ <slot :item="item" :index="index">
12
+ {{ item.label }}
13
+ </slot>
14
+ </view>
15
+ </movable-view>
16
+ </movable-area>
28
17
  </view>
29
- </view>
30
18
  </template>
31
19
 
32
20
  <script>
21
+ import { mpMixin } from '../../libs/mixin/mpMixin';
22
+ import { mixin } from '../../libs/mixin/mixin';
23
+ import { addStyle, addUnit, sleep } from '../../libs/function/index';
33
24
  export default {
34
- name: 'u-dragsort',
35
- props: {
36
- initialList: {
37
- type: Array,
38
- required: true,
39
- default: () => []
40
- },
41
- // 新增 draggable 属性
42
- draggable: {
43
- type: Boolean,
44
- default: true
45
- },
46
- direction: {
47
- type: String,
48
- default: 'vertical', // 可选值:'vertical' / 'horizontal'
49
- validator: value => ['vertical', 'horizontal'].includes(value)
50
- }
51
- },
52
- data() {
53
- return {
54
- list: [...this.initialList],
55
- itemRefs: [], // 存储每个 item 的 ref
56
- itemRects: [], // 缓存所有 item 的 rect
57
- dragIndex: -1,
58
- dragX: 0,
59
- dragY: 0,
60
- startX: 0,
61
- startY: 0,
62
- itemWidth: 0, // 横向拖动需要宽度
63
- itemHeight: 80,
64
- isDragging: false,
65
- closestIndex: -1, // 用于临时存储最接近的 index
66
- lastSwapTime: 0, // 新增:记录上次交换时间
67
- initialTouchY: 0, // 新增:记录初始触摸位置
68
- minDragDistance: 15, // 新增:最小拖动距离阈值
69
- dragStartY: 0, // 新增:记录拖动开始位置
70
- confirmedDirection: null, // 新增:确认的拖动方向
71
- };
72
- },
73
- emits: ['drag-end'],
74
- async mounted() {
75
- await this.$nextTick();
76
- const rect = await this.calculateItemSize(0);
77
- this.itemWidth = rect.width;
78
- this.itemHeight = rect.height;
79
- },
80
- methods: {
81
- setItemRef(el, index) {
82
- this.itemRefs[index] = el;
25
+ name: 'u-dragsort',
26
+ // #ifdef MP
27
+ mixins: [mpMixin, mixin,],
28
+ // #endif
29
+ // #ifndef MP
30
+ mixins: [mixin],
31
+ // #endif
32
+ props: {
33
+ initialList: {
34
+ type: Array,
35
+ required: true,
36
+ default: () => []
37
+ },
38
+ draggable: {
39
+ type: Boolean,
40
+ default: true
41
+ },
42
+ direction: {
43
+ type: String,
44
+ default: 'vertical',
45
+ validator: value => ['vertical', 'horizontal', 'all'].includes(value)
46
+ },
47
+ // 新增列数属性,用于all模式
48
+ columns: {
49
+ type: Number,
50
+ default: 3
51
+ }
83
52
  },
84
- async calculateItemSize(index) {
85
- return new Promise((resolve) => {
86
- uni.createSelectorQuery()
87
- .in(this)
88
- .select(`#u-dragsort-item-${index}`)
89
- .boundingClientRect(res => {
90
- resolve(res || { width: 80, height: 80 });
91
- })
92
- .exec();
93
- });
53
+ data() {
54
+ return {
55
+ list: [],
56
+ dragIndex: -1,
57
+ itemHeight: 40,
58
+ itemWidth: 80,
59
+ areaWidth: 0, // 可拖动区域宽度
60
+ areaHeight: 0, // 可拖动区域高度
61
+ originalPositions: [], // 保存原始位置
62
+ currentPosition: {
63
+ x: 0,
64
+ y: 0
65
+ }
66
+ };
94
67
  },
95
- async updateItemRects() {
96
- const rects = await this.getAllItemRects();
97
- this.itemRects = rects;
68
+ computed: {
69
+ movableAreaStyle() {
70
+ if (this.direction === 'vertical') {
71
+ return {
72
+ height: `${this.list.length * this.itemHeight}px`,
73
+ width: '100%'
74
+ };
75
+ } else if (this.direction === 'horizontal') {
76
+ return {
77
+ height: '100%',
78
+ width: `${this.list.length * this.itemWidth}px`
79
+ };
80
+ } else {
81
+ // all模式,计算网格布局所需的高度
82
+ const rows = Math.ceil(this.list.length / this.columns);
83
+ return {
84
+ height: `${rows * this.itemHeight}px`,
85
+ width: '100%'
86
+ };
87
+ }
88
+ }
98
89
  },
99
- async getAllItemRects() {
100
- return new Promise(resolve => {
101
- uni.createSelectorQuery()
102
- .in(this)
103
- .selectAll('.u-dragsort-item')
104
- .boundingClientRect(res => {
105
- resolve(res || []);
106
- })
107
- .exec();
108
- });
90
+ emits: ['drag-end'],
91
+ async mounted() {
92
+ await this.$nextTick();
93
+ this.initList();
94
+ this.calculateItemSize();
95
+ this.calculateAreaSize();
109
96
  },
110
- onTouchStart(index, event) {
111
- // ⚠️ 如果禁止拖动,则直接返回
112
- if (!this.draggable || (this.list[index]?.draggable == false)) return;
97
+ methods: {
98
+ initList() {
99
+ // 初始化列表项的位置
100
+ this.list = this.initialList.map((item, index) => {
101
+ let x = 0, y = 0;
113
102
 
114
- const touch = event.touches[0];
115
- this.dragIndex = index;
116
- this.startX = touch.clientX;
117
- this.startY = touch.clientY;
118
- // 记录初始触摸位置
119
- this.initialTouchY = touch.clientY;
120
- this.dragX = 0;
121
- this.dragY = 0;
122
- this.isDragging = true;
103
+ if (this.direction === 'horizontal') {
104
+ x = index * this.itemWidth;
105
+ y = 0;
106
+ } else if (this.direction === 'vertical') {
107
+ x = 0;
108
+ y = index * this.itemHeight;
109
+ } else {
110
+ // all模式,网格布局
111
+ const col = index % this.columns;
112
+ const row = Math.floor(index / this.columns);
113
+ x = col * this.itemWidth;
114
+ y = row * this.itemHeight;
115
+ }
123
116
 
124
- // 记录拖动开始位置
125
- this.dragStartY = touch.clientY;
126
- this.confirmedDirection = null;
117
+ return {
118
+ ...item,
119
+ x,
120
+ y
121
+ };
122
+ });
123
+ // 保存初始位置
124
+ this.saveOriginalPositions();
125
+ },
126
+ saveOriginalPositions() {
127
+ // 保存当前位置作为原始位置
128
+ this.originalPositions = this.list.map(item => ({
129
+ x: item.x,
130
+ y: item.y
131
+ }));
132
+ },
133
+ async calculateItemSize() {
134
+ // 计算项目尺寸
135
+ await sleep(30);
136
+ return new Promise((resolve) => {
137
+ uni.createSelectorQuery()
138
+ .in(this)
139
+ .select('.u-dragsort-item-content')
140
+ .boundingClientRect(res => {
141
+ if (res) {
142
+ this.itemHeight = res.height || 40;
143
+ this.itemWidth = res.width || 80;
127
144
 
128
- this.updateItemRects(); // 更新缓存
129
- },
130
- // throttle(func, delay) {
131
- // let lastCall = 0;
132
- // return (...args) => {
133
- // const now = new Date().getTime();
134
- // if (now - lastCall >= delay) {
135
- // lastCall = now;
136
- // func.apply(this, args);
137
- // }
138
- // };
139
- // },
140
- handleDragMove(event) {
141
- if (this.dragIndex === -1 || !this.draggable) return;
145
+ // 更新所有项目的位置
146
+ this.updatePositions();
147
+ // 保存原始位置
148
+ this.saveOriginalPositions();
149
+ }
150
+ resolve(res);
151
+ })
152
+ .exec();
153
+ });
154
+ },
155
+ async calculateAreaSize() {
156
+ // 计算可拖动区域尺寸
157
+ await sleep(30);
158
+ return new Promise((resolve) => {
159
+ uni.createSelectorQuery()
160
+ .in(this)
161
+ .select('.u-dragsort-area')
162
+ .boundingClientRect(res => {
163
+ if (res) {
164
+ this.areaWidth = res.width || 300;
165
+ this.areaHeight = res.height || 300;
166
+ }
167
+ resolve(res);
168
+ })
169
+ .exec();
170
+ });
171
+ },
172
+ updatePositions() {
173
+ // 更新所有项目的位置
174
+ this.list.forEach((item, index) => {
175
+ if (this.direction === 'vertical') {
176
+ item.y = index * this.itemHeight;
177
+ item.x = 0;
178
+ } else if (this.direction === 'horizontal') {
179
+ item.x = index * this.itemWidth;
180
+ item.y = 0;
181
+ } else {
182
+ // all模式,网格布局
183
+ const col = index % this.columns;
184
+ const row = Math.floor(index / this.columns);
185
+ item.x = col * this.itemWidth;
186
+ item.y = row * this.itemHeight;
187
+ }
188
+ });
189
+ },
190
+ onTouchStart(index) {
191
+ this.dragIndex = index;
192
+ // 保存当前位置作为原始位置
193
+ this.saveOriginalPositions();
194
+ },
195
+ onChange(index, event) {
196
+ if (!event.detail.source || event.detail.source !== 'touch') return;
142
197
 
143
- const touch = event.touches[0];
144
- const currentX = touch.clientX;
145
- const currentY = touch.clientY;
198
+ this.currentPosition.x = event.detail.x;
199
+ this.currentPosition.y = event.detail.y;
146
200
 
147
- const deltaX = currentX - this.startX;
148
-
149
- // 1. 计算总拖动距离
150
- const totalDragDistance = Math.abs(currentY - this.dragStartY);
151
-
152
- // 2. 如果拖动距离小于阈值,不进行位置检测
153
- if (totalDragDistance < this.minDragDistance) {
154
- // 只更新位置,不检测交换
155
- this.dragY = currentY - this.initialTouchY;
156
- return;
157
- }
158
-
159
- // 3. 确认拖动方向(只做一次)
160
- if (!this.confirmedDirection) {
161
- this.confirmedDirection = currentY > this.dragStartY ? 'down' : 'up';
162
- }
163
-
164
- this.dragY = currentY - this.initialTouchY;
201
+ // all模式下使用更智能的位置计算
202
+ if (this.direction === 'all') {
203
+ this.handleAllModeChange(index);
204
+ } else {
205
+ // 原有的垂直和水平模式逻辑
206
+ let itemSize = 0;
207
+ let targetIndex = -1;
165
208
 
166
- if (this.direction === 'horizontal') {
167
- this.dragX = deltaX;
209
+ if (this.direction === 'vertical') {
210
+ itemSize = this.itemHeight;
211
+ targetIndex = Math.max(0, Math.min(
212
+ Math.round(this.currentPosition.y / itemSize),
213
+ this.list.length - 1
214
+ ));
215
+ } else if (this.direction === 'horizontal') {
216
+ itemSize = this.itemWidth;
217
+ targetIndex = Math.max(0, Math.min(
218
+ Math.round(this.currentPosition.x / itemSize),
219
+ this.list.length - 1
220
+ ));
221
+ }
168
222
 
169
- // 只缓存 rect,不立即交换
170
- let closestIndex = this.dragIndex;
171
- let minDistance = Infinity;
223
+ // 如果位置发生变化,则重新排序
224
+ if (targetIndex !== index) {
225
+ this.reorderItems(index, targetIndex);
226
+ }
227
+ }
228
+ },
229
+ handleAllModeChange(index) {
230
+ // 在all模式下,根据当前位置计算最近的网格位置
231
+ const col = Math.max(0, Math.min(Math.round(this.currentPosition.x / this.itemWidth), this.columns - 1));
232
+ const row = Math.max(0, Math.round(this.currentPosition.y / this.itemHeight));
172
233
 
173
- this.itemRects.forEach((rect, index) => {
174
- if (index === this.dragIndex) return;
234
+ // 计算目标索引
235
+ let targetIndex = row * this.columns + col;
236
+ targetIndex = Math.max(0, Math.min(targetIndex, this.list.length - 1));
175
237
 
176
- const centerX = rect.left + rect.width / 2;
177
- const centerY = rect.top + rect.height / 2;
178
- const dist = Math.hypot(currentX - centerX, currentY - centerY);
238
+ // 如果位置发生变化,则重新排序
239
+ if (targetIndex !== index) {
240
+ this.reorderItems(index, targetIndex);
241
+ }
242
+ },
243
+ reorderItems(fromIndex, toIndex) {
244
+ const movedItem = this.list.splice(fromIndex, 1)[0];
245
+ this.list.splice(toIndex, 0, movedItem);
179
246
 
180
- if (dist < minDistance) {
181
- minDistance = dist;
182
- closestIndex = index;
247
+ // 震动反馈
248
+ if (uni.vibrateShort) {
249
+ uni.vibrateShort();
183
250
  }
184
- });
185
251
 
186
- // 设置临时高亮/排序索引,并立即修改 list
187
- if (closestIndex !== this.closestIndex && closestIndex !== this.dragIndex) {
188
- const temp = this.list[this.dragIndex];
189
- this.list.splice(this.dragIndex, 1);
190
- this.list.splice(closestIndex, 0, temp);
252
+ // 更新当前拖拽项目的新索引
253
+ this.dragIndex = toIndex;
191
254
 
192
- this.dragIndex = closestIndex;
193
- this.closestIndex = closestIndex;
194
- }
195
- } else {
196
- // 4. 添加更严格的防抖
197
- const now = Date.now();
198
- if (now - this.lastSwapTime < 200) return; // 延长防抖时间
199
-
200
- // 5. 使用方向感知的目标位置计算
201
- const targetIndex = this.calculateTargetPosition(currentY);
202
-
203
- if (targetIndex !== -1 && targetIndex !== this.dragIndex) {
204
- this.lastSwapTime = now;
205
- this.swapItems(targetIndex, event);
255
+ // 更新所有项目的位置
256
+ this.updatePositions();
257
+
258
+ // 保存当前位置作为原始位置
259
+ this.saveOriginalPositions();
260
+ },
261
+ onTouchEnd() {
262
+ // 0.001是为了解决拖动过快等某些极限场景下位置还原不生效问题
263
+ if (this.direction === 'horizontal') {
264
+ this.list[this.dragIndex].x = this.currentPosition.x + 0.001;
265
+ } else if (this.direction === 'vertical' || this.direction === 'all') {
266
+ this.list[this.dragIndex].y = this.currentPosition.y + 0.001;
267
+ this.list[this.dragIndex].x = this.currentPosition.x + 0.001;
206
268
  }
269
+
270
+ // 重置到位置,需要延迟触发动,否则无效。
271
+ sleep(50).then(() => {
272
+ this.list.forEach((item, index) => {
273
+ item.x = this.originalPositions[index].x;
274
+ item.y = this.originalPositions[index].y;
275
+ });
276
+ this.dragIndex = -1;
277
+ this.$emit('drag-end', [...this.list]);
278
+ });
207
279
  }
208
280
  },
209
- // 优化:更精准的方向感知位置计算
210
- calculateTargetPosition(currentY) {
211
- // 获取拖动项的中心Y坐标
212
- const dragCenterY = currentY;
213
- let closestIndex = -1;
214
- let minDistance = Infinity;
215
-
216
- // 获取拖动项的高度
217
- const dragHeight = this.itemRects[this.dragIndex]?.height || this.itemHeight;
218
-
219
- for (let i = 0; i < this.itemRects.length; i++) {
220
- if (i === this.dragIndex) continue;
221
-
222
- const rect = this.itemRects[i];
223
- if (!rect) continue;
224
-
225
- const rectCenterY = rect.top + rect.height / 2;
226
- const distance = Math.abs(dragCenterY - rectCenterY);
227
-
228
- // 6. 方向过滤:只考虑当前拖动方向上的元素
229
- const isDirectionMatch =
230
- (this.confirmedDirection === 'down' && i > this.dragIndex) ||
231
- (this.confirmedDirection === 'up' && i < this.dragIndex);
232
-
233
- if (!isDirectionMatch) continue;
234
-
235
- // 7. 使用更大的阈值(元素高度的1.2倍)
236
- const threshold = dragHeight * 1.2;
237
-
238
- if (distance < minDistance && distance < threshold) {
239
- minDistance = distance;
240
- closestIndex = i;
281
+ watch: {
282
+ initialList: {
283
+ handler() {
284
+ this.$nextTick(() => {
285
+ this.initList();
286
+ });
287
+ },
288
+ deep: true
289
+ },
290
+ direction: {
291
+ handler() {
292
+ this.$nextTick(() => {
293
+ this.initList();
294
+ this.calculateItemSize();
295
+ this.calculateAreaSize();
296
+ });
241
297
  }
242
- }
243
-
244
- return closestIndex;
245
- },
246
-
247
- // 优化:添加平滑交换
248
- swapItems(targetIndex, event) {
249
- const originalIndex = this.dragIndex;
250
-
251
- // 6. 执行交换前保存当前样式
252
- const originalTransform = this.$refs[`u-dragsort-item-${originalIndex}`]?.style.transform;
253
-
254
- // 执行交换
255
- const temp = this.list[originalIndex];
256
- this.list.splice(originalIndex, 1);
257
- this.list.splice(targetIndex, 0, temp);
258
-
259
- // 更新索引
260
- this.dragIndex = targetIndex;
261
- this.closestIndex = targetIndex;
262
-
263
- // 7. 使用当前触摸位置更新初始位置
264
- if (event && event.touches && event.touches[0]) {
265
- this.initialTouchY = event.touches[0].clientY;
266
- this.dragY = 0;
267
- }
268
-
269
- // 8. 添加位置平滑过渡
270
- this.$nextTick(() => {
271
- const dragItem = this.$refs[`u-dragsort-item-${targetIndex}`];
272
- if (dragItem) {
273
- // 保存当前位置
274
- const currentTransform = dragItem.style.transform;
275
-
276
- // 临时添加过渡效果
277
- dragItem.style.transition = 'transform 0.15s ease';
278
- dragItem.style.transform = currentTransform;
279
-
280
- // 过渡结束后移除效果
281
- setTimeout(() => {
282
- dragItem.style.transition = '';
283
- }, 150);
298
+ },
299
+ columns: {
300
+ handler() {
301
+ if (this.direction === 'all') {
302
+ this.$nextTick(() => {
303
+ this.initList();
304
+ this.updatePositions();
305
+ this.saveOriginalPositions();
306
+ });
307
+ }
284
308
  }
285
- });
286
-
287
- // 更新位置缓存
288
- this.updateItemRects();
289
- },
290
-
291
- onTouchMove(event) {
292
- // 记录当前Y坐标用于方向判断
293
- if (event.touches && event.touches[0]) {
294
- this.prevY = event.touches[0].clientY;
295
- }
296
-
297
- // 使用requestAnimationFrame确保流畅性
298
- if (!this.rafId) {
299
- this.rafId = requestAnimationFrame(() => {
300
- this.handleDragMove(event);
301
- this.rafId = null;
302
- });
303
- }
304
- },
305
- onTouchEnd() {
306
- // 取消动画帧
307
- if (this.rafId) {
308
- cancelAnimationFrame(this.rafId);
309
- this.rafId = null;
310
309
  }
311
-
312
- // if (this.isDragging && this.closestIndex !== -1 && this.closestIndex !== this.dragIndex) {
313
- // const temp = this.list[this.dragIndex];
314
- // this.list.splice(this.dragIndex, 1);
315
- // this.list.splice(this.closestIndex, 0, temp);
316
- // this.dragIndex = this.closestIndex;
317
- // }
318
-
319
- this.$emit('drag-end', this.list);
320
- this.dragIndex = -1;
321
- this.dragX = 0;
322
- this.dragY = 0;
323
- this.isDragging = false;
324
- this.closestIndex = -1;
325
310
  }
326
- }
327
311
  };
328
312
  </script>
329
313
 
330
314
  <style scoped lang="scss">
331
315
  .u-dragsort {
332
- width: 100%;
316
+ width: 100%;
333
317
 
334
- .u-dragsort-item {
335
- // transition: transform 0.15s ease, margin-top 0.15s ease;
336
- transition: transform 0.25s cubic-bezier(0.33, 1, 0.68, 1);
337
- &.dragging {
338
- // 拖动时禁用过渡
339
- // transition: none;
340
- // 确保在最上层
341
- z-index: 1000;
342
- // transform: scale(1.05);
343
- box-shadow: 0 6px 20px rgba(0,0,0,0.15);
344
- }
345
- &.nearby {
346
- opacity: 95;
347
- transform: scale(1.02);
318
+ .u-dragsort-area {
319
+ width: 100%;
320
+ position: relative;
348
321
  }
349
- .u-dragsort-item-content {
350
- padding: 10px;
351
- text-align: center;
352
- background-color: #f5f5f5;
353
- border-radius: 8rpx;
354
- transition: all 0.3s ease;
355
- }
356
- }
357
322
 
358
- &.u-dragsort--horizontal {
359
- display: flex;
360
- flex-direction: row;
361
- flex-wrap: wrap;
362
- overflow: visible; // 取消滚动条,允许自然换行
363
323
  .u-dragsort-item {
364
- flex-shrink: 0;
365
- box-sizing: border-box;
324
+ position: absolute;
325
+ width: 100%;
326
+
327
+ &.dragging {
328
+ z-index: 1000;
329
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
330
+ }
331
+
366
332
  .u-dragsort-item-content {
367
- margin: 1px;
333
+ padding: 0px;
334
+ text-align: center;
335
+ box-sizing: border-box;
336
+ padding-bottom: 6px;
337
+ border-radius: 8rpx;
338
+ transition: all 0.3s ease;
339
+ }
340
+ }
341
+
342
+ &.u-dragsort--horizontal {
343
+ .u-dragsort-area {
344
+ display: flex;
345
+ white-space: nowrap;
346
+ height: auto;
347
+ }
348
+
349
+ .u-dragsort-item {
350
+ display: flex;
351
+ width: auto;
352
+ height: 100%;
353
+ }
354
+ }
355
+
356
+ &.u-dragsort--all {
357
+ .u-dragsort-area {
358
+ height: auto;
359
+ }
360
+
361
+ .u-dragsort-item {
362
+ width: auto;
363
+ height: auto;
368
364
  }
369
365
  }
370
- }
371
366
  }
372
- </style>
367
+ </style>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙移动组件库。",
5
- "version": "3.4.62",
5
+ "version": "3.4.64",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水。",
7
7
  "keywords": [
8
8
  "uview",