uview-plus 3.3.6 → 3.3.7

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 (38) hide show
  1. package/changelog.md +45 -0
  2. package/components/u-action-sheet/props.js +6 -1
  3. package/components/u-action-sheet/u-action-sheet.vue +4 -5
  4. package/components/u-cell/u-cell.vue +20 -1
  5. package/components/u-checkbox/u-checkbox.vue +28 -18
  6. package/components/u-code/u-code.vue +0 -5
  7. package/components/u-count-down/u-count-down.vue +0 -5
  8. package/components/u-form-item/u-form-item.vue +1 -1
  9. package/components/u-grid-item/u-grid-item.vue +0 -5
  10. package/components/u-index-list/props.js +6 -1
  11. package/components/u-index-list/u-index-list.vue +169 -42
  12. package/components/u-modal/u-modal.vue +3 -3
  13. package/components/u-notify/u-notify.vue +0 -5
  14. package/components/u-number-box/u-number-box.vue +1 -0
  15. package/components/u-parse/node/node.vue +1 -1
  16. package/components/u-parse/u-parse.vue +1 -7
  17. package/components/u-picker/u-picker.vue +1 -0
  18. package/components/u-popup/u-popup.vue +3 -1
  19. package/components/u-row-notice/u-row-notice.vue +1 -8
  20. package/components/u-scroll-list/nvue.js +1 -1
  21. package/components/u-scroll-list/u-scroll-list.vue +5 -2
  22. package/components/u-slider/props.js +45 -19
  23. package/components/u-slider/u-slider.vue +376 -7
  24. package/components/u-sticky/u-sticky.vue +0 -5
  25. package/components/u-swipe-action-item/nvue.js +0 -5
  26. package/components/u-tabs/u-tabs.vue +11 -3
  27. package/components/u-toast/u-toast.vue +10 -10
  28. package/components/u-upload/u-upload.vue +9 -4
  29. package/components/u-upload/utils.js +10 -4
  30. package/components/u-waterfall/u-waterfall.vue +1 -1
  31. package/libs/config/props/actionSheet.js +2 -1
  32. package/libs/config/props/indexList.js +2 -1
  33. package/libs/config/props/slider.js +3 -1
  34. package/libs/css/common.scss +1 -1
  35. package/libs/mixin/mixin.js +1 -7
  36. package/package.json +1 -1
  37. package/types/index.d.ts +155 -29
  38. package/components/u-slider/nvue - /345/211/257/346/234/254.js" +0 -180
@@ -20,10 +20,10 @@
20
20
  width: addUnit(width),
21
21
  }"
22
22
  >
23
- <text
23
+ <view
24
24
  class="u-modal__title"
25
25
  v-if="title"
26
- >{{ title }}</text>
26
+ >{{ title }}</view>
27
27
  <view
28
28
  class="u-modal__content"
29
29
  :style="{
@@ -174,7 +174,7 @@
174
174
  overflow: hidden;
175
175
 
176
176
  &__title {
177
- display: block;
177
+ display: flex;
178
178
  font-size: 16px;
179
179
  font-weight: bold;
180
180
  color: $u-content-color;
@@ -166,12 +166,7 @@
166
166
  this.timer = null
167
167
  }
168
168
  },
169
- // #ifdef VUE2
170
- beforeDestroy() {
171
- // #endif
172
- // #ifdef VUE3
173
169
  beforeUnmount() {
174
- // #endif
175
170
  this.clearTimer()
176
171
  }
177
172
  }
@@ -259,6 +259,7 @@
259
259
  const val = this.format(this.currentValue);
260
260
  if (val !== this.currentValue) {
261
261
  this.currentValue = val
262
+ this.emitChange(val)
262
263
  }
263
264
  },
264
265
  // 判断是否出于禁止操作状态
@@ -168,7 +168,7 @@ export default {
168
168
  }
169
169
  // #endif
170
170
  },
171
- beforeDestroy () {
171
+ beforeUnmount () {
172
172
  // #ifdef H5 || APP-PLUS
173
173
  if (this.observer) {
174
174
  this.observer.disconnect()
@@ -126,13 +126,7 @@ export default {
126
126
  this.setContent(this.content)
127
127
  }
128
128
  },
129
- // #ifdef VUE2
130
- // beforeDestroy()
131
- // #endif
132
- // #ifdef VUE3
133
- beforeUnmount()
134
- // #endif
135
- {
129
+ beforeUnmount() {
136
130
  this._hook('onDetached')
137
131
  },
138
132
  methods: {
@@ -112,6 +112,7 @@ export default {
112
112
  // 监听默认索引的变化,重新设置对应的值
113
113
  defaultIndex: {
114
114
  immediate: true,
115
+ deep:true,
115
116
  handler(n) {
116
117
  this.setIndexs(n, true)
117
118
  }
@@ -177,15 +177,17 @@
177
177
  }
178
178
  },
179
179
  },
180
- emits: ["open", "close", "click"],
180
+ emits: ["open", "close", "click", "update:show"],
181
181
  methods: {
182
182
  // 点击遮罩
183
183
  overlayClick() {
184
184
  if (this.closeOnClickOverlay) {
185
+ this.$emit('update:show', false)
185
186
  this.$emit('close')
186
187
  }
187
188
  },
188
189
  close(e) {
190
+ this.$emit('update:show', false)
189
191
  this.$emit('close')
190
192
  },
191
193
  afterEnter() {
@@ -275,16 +275,9 @@
275
275
  this.$emit('close')
276
276
  }
277
277
  },
278
- // #ifdef APP-NVUE
279
- // #ifdef VUE2
280
- beforeDestroy() {
281
- // #endif
282
- // #ifdef VUE3
283
278
  beforeUnmount() {
284
- // #endif
285
279
  this.stopAnimation = true
286
- },
287
- // #endif
280
+ }
288
281
  };
289
282
  </script>
290
283
 
@@ -6,7 +6,7 @@ export default {
6
6
  // 此处不写注释,请自行体会
7
7
  nvueScrollHandler(e) {
8
8
  const anchor = this.$refs['u-scroll-list__scroll-view'].ref
9
- const element = {}
9
+ let element = {}
10
10
  if (this.$refs['u-scroll-list__indicator__line__bar']) {
11
11
  element = this.$refs['u-scroll-list__indicator__line__bar'].ref
12
12
  }
@@ -22,8 +22,9 @@
22
22
  <!-- #ifdef MP-WEIXIN || APP-VUE || H5 || MP-QQ -->
23
23
  <!-- 以上平台,支持wxs -->
24
24
  <scroll-view
25
- class="u-scroll-list__scroll-view"
25
+ class="u-scroll-list__scroll-view scroll-view-native"
26
26
  scroll-x
27
+ enable-flex
27
28
  @scroll="wxs.scroll"
28
29
  @scrolltoupper="wxs.scrolltoupper"
29
30
  @scrolltolower="wxs.scrolltolower"
@@ -38,7 +39,7 @@
38
39
  <!-- #ifndef APP-NVUE || MP-WEIXIN || H5 || APP-VUE || MP-QQ -->
39
40
  <!-- 非以上平台,只能使用普通js实现 -->
40
41
  <scroll-view
41
- class="u-scroll-list__scroll-view"
42
+ class="u-scroll-list__scroll-view scroll-view-js"
42
43
  scroll-x
43
44
  @scroll="scrollHandler"
44
45
  @scrolltoupper="scrolltoupperHandler"
@@ -204,6 +205,8 @@ export default {
204
205
 
205
206
  &__scroll-view {
206
207
  @include flex;
208
+ // 缺少会在enable-flex模式下高度异常
209
+ align-items: flex-start;
207
210
 
208
211
  &__content {
209
212
  @include flex;
@@ -1,5 +1,6 @@
1
1
  import { defineMixin } from '../../libs/vue'
2
2
  import defProps from '../../libs/config/props.js'
3
+
3
4
  export const props = defineMixin({
4
5
  props: {
5
6
  // 最小可选值
@@ -17,20 +18,30 @@ export const props = defineMixin({
17
18
  type: [Number, String],
18
19
  default: () => defProps.slider.step
19
20
  },
20
- // #ifdef VUE3
21
- // 当前取值
22
- modelValue: {
23
- type: [String, Number],
24
- default: () => defProps.slider.value
25
- },
26
- // #endif
27
- // #ifdef VUE2
28
- // 当前取值
29
- value: {
30
- type: [String, Number],
31
- default: () => defProps.slider.value
32
- },
33
- // #endif
21
+ // #ifdef VUE3
22
+ // 当前取值
23
+ modelValue: {
24
+ type: [String, Number],
25
+ default: () => defProps.slider.value
26
+ },
27
+ // #endif
28
+ // #ifdef VUE2
29
+ // 当前取值
30
+ value: {
31
+ type: [String, Number],
32
+ default: () => defProps.slider.value
33
+ },
34
+ // #endif
35
+ // 是否区间模式
36
+ isRange: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ // 双滑块时值
41
+ rangeValue: {
42
+ type: [Array],
43
+ default: [0, 0]
44
+ },
34
45
  // 滑块右侧已选择部分的背景色
35
46
  activeColor: {
36
47
  type: String,
@@ -51,15 +62,30 @@ export const props = defineMixin({
51
62
  type: String,
52
63
  default: () => defProps.slider.blockColor
53
64
  },
54
- // 禁用状态
55
- disabled: {
56
- type: Boolean,
57
- default: () => defProps.slider.disabled
58
- },
65
+ // 用户对滑块的自定义颜色
66
+ blockStyle: {
67
+ type: Object,
68
+ default: () => defProps.slider.blockStyle
69
+ },
70
+ // 禁用状态
71
+ disabled: {
72
+ type: Boolean,
73
+ default: () => defProps.slider.disabled
74
+ },
59
75
  // 是否显示当前的选择值
60
76
  showValue: {
61
77
  type: Boolean,
62
78
  default: () => defProps.slider.showValue
79
+ },
80
+ // 是否渲染uni-app框架内置组件
81
+ useNative: {
82
+ type: Boolean,
83
+ default: () => defProps.slider.useNative
84
+ },
85
+ // 滑块高度
86
+ height: {
87
+ type: String,
88
+ default: () => defProps.slider.height
63
89
  }
64
90
  }
65
91
  })
@@ -3,7 +3,82 @@
3
3
  class="u-slider"
4
4
  :style="[addStyle(customStyle)]"
5
5
  >
6
+ <template v-if="!useNative || isRange">
7
+ <view ref="u-slider-inner" class="u-slider-inner" @tap="onClick"
8
+ :class="[disabled ? 'u-slider--disabled' : '']" :style="{
9
+ height: (isRange && showValue) ? (getPx(blockSize) + 24) + 'px' : (getPx(blockSize)) + 'px',
10
+ }"
11
+ >
12
+ <view ref="u-slider__base"
13
+ class="u-slider__base"
14
+ :style="[
15
+ {
16
+ height: height,
17
+ backgroundColor: inactiveColor
18
+ }
19
+ ]"
20
+ >
21
+ </view>
22
+ <view
23
+ class="u-slider__gap"
24
+ :style="[
25
+ barStyle,
26
+ {
27
+ height: height,
28
+ marginTop: '-' + height,
29
+ backgroundColor: activeColor
30
+ }
31
+ ]"
32
+ >
33
+ </view>
34
+ <view v-if="isRange"
35
+ class="u-slider__gap u-slider__gap-0"
36
+ :style="[
37
+ barStyle0,
38
+ {
39
+ height: height,
40
+ marginTop: '-' + height,
41
+ backgroundColor: inactiveColor
42
+ }
43
+ ]"
44
+ >
45
+ </view>
46
+ <text v-if="isRange && showValue"
47
+ class="u-slider__show-range-value" :style="{left: (getPx(barStyle0.width) + getPx(blockSize)/2) + 'px'}">
48
+ {{ this.rangeValue[0] }}
49
+ </text>
50
+ <text v-if="isRange && showValue"
51
+ class="u-slider__show-range-value" :style="{left: (getPx(barStyle.width) + getPx(blockSize)/2) + 'px'}">
52
+ {{ this.rangeValue[1] }}
53
+ </text>
54
+ <template v-if="isRange">
55
+ <view class="u-slider__button-wrap u-slider__button-wrap-0" @touchstart="onTouchStart($event, 0)"
56
+ @touchmove="onTouchMove($event, 0)" @touchend="onTouchEnd($event, 0)"
57
+ @touchcancel="onTouchEnd($event, 0)" :style="{left: (getPx(barStyle0.width) + getPx(blockSize)/2) + 'px'}">
58
+ <slot v-if="$slots.default || $slots.$default"/>
59
+ <view v-else class="u-slider__button" :style="[blockStyle, {
60
+ height: getPx(blockSize, true),
61
+ width: getPx(blockSize, true),
62
+ backgroundColor: blockColor
63
+ }]"></view>
64
+ </view>
65
+ </template>
66
+ <view class="u-slider__button-wrap" @touchstart="onTouchStart"
67
+ @touchmove="onTouchMove" @touchend="onTouchEnd"
68
+ @touchcancel="onTouchEnd" :style="{left: (getPx(barStyle.width) + getPx(blockSize)/2) + 'px'}">
69
+ <slot v-if="$slots.default || $slots.$default"/>
70
+ <view v-else class="u-slider__button" :style="[blockStyle, {
71
+ height: getPx(blockSize, true),
72
+ width: getPx(blockSize, true),
73
+ backgroundColor: blockColor
74
+ }]"></view>
75
+ </view>
76
+ </view>
77
+ <view class="u-slider__show-value" v-if="showValue && !isRange">{{ modelValue }}</view>
78
+ </template>
6
79
  <slider
80
+ class="u-slider__native"
81
+ v-else
7
82
  :min="min"
8
83
  :max="max"
9
84
  :step="step"
@@ -24,15 +99,105 @@
24
99
  import { props } from './props';
25
100
  import { mpMixin } from '../../libs/mixin/mpMixin';
26
101
  import { mixin } from '../../libs/mixin/mixin';
27
- import { addStyle, getPx } from '../../libs/function/index.js';
102
+ import { addStyle, getPx, sleep } from '../../libs/function/index.js';
103
+ // #ifdef APP-NVUE
104
+ const dom = uni.requireNativePlugin('dom')
105
+ // #endif
106
+ /**
107
+ * slider 滑块选择器
108
+ * @tutorial https://uview-plus.jiangruyi.com/components/slider.html
109
+ * @property {Number | String} value 滑块默认值(默认0)
110
+ * @property {Number | String} min 最小值(默认0)
111
+ * @property {Number | String} max 最大值(默认100)
112
+ * @property {Number | String} step 步长(默认1)
113
+ * @property {Number | String} blockWidth 滑块宽度,高等于宽(30)
114
+ * @property {Number | String} height 滑块条高度,单位rpx(默认6)
115
+ * @property {String} inactiveColor 底部条背景颜色(默认#c0c4cc)
116
+ * @property {String} activeColor 底部选择部分的背景颜色(默认#2979ff)
117
+ * @property {String} blockColor 滑块颜色(默认#ffffff)
118
+ * @property {Object} blockStyle 给滑块自定义样式,对象形式
119
+ * @property {Boolean} disabled 是否禁用滑块(默认为false)
120
+ * @event {Function} changing 正在滑动中
121
+ * @event {Function} change 滑动结束
122
+ * @example <up-slider v-model="value" />
123
+ */
28
124
  export default {
29
- name: 'up-slider',
125
+ name: 'u-slider',
30
126
  mixins: [mpMixin, mixin, props],
31
- emits: ["changing", "change", "update:modelValue"],
127
+ emits: ["start", "changing", "change", "update:modelValue"],
128
+ data() {
129
+ return {
130
+ startX: 0,
131
+ status: 'end',
132
+ newValue: 0,
133
+ distanceX: 0,
134
+ startValue0: 0,
135
+ startValue: 0,
136
+ barStyle0: {},
137
+ barStyle: {},
138
+ sliderRect: {
139
+ left: 0,
140
+ width: 0
141
+ }
142
+ };
143
+ },
144
+ watch: {
145
+ // #ifdef VUE3
146
+ modelValue(n) {
147
+ // 只有在非滑动状态时,才可以通过value更新滑块值,这里监听,是为了让用户触发
148
+ if(this.status == 'end') this.updateValue(this.modelValue, false);
149
+ },
150
+ // #endif
151
+ // #ifdef VUE2
152
+ value(n) {
153
+ // 只有在非滑动状态时,才可以通过value更新滑块值,这里监听,是为了让用户触发
154
+ if(this.status == 'end') this.updateValue(this.value, false);
155
+ }
156
+ // #endif
157
+ },
158
+ created() {
159
+ },
160
+ async mounted() {
161
+ // 获取滑块条的尺寸信息
162
+ if (!this.useNative) {
163
+ // #ifndef APP-NVUE
164
+ this.$uGetRect('.u-slider__base').then(rect => {
165
+ this.sliderRect = rect;
166
+ this.init()
167
+ });
168
+ // #endif
169
+ // #ifdef APP-NVUE
170
+ await sleep(30) // 不延迟会出现size获取都为0的问题
171
+ const ref = this.$refs['u-slider__base']
172
+ ref &&
173
+ dom.getComponentRect(ref, (res) => {
174
+ // console.log(res)
175
+ this.sliderRect = {
176
+ left: res.size.left,
177
+ width: res.size.width
178
+ };
179
+ this.init()
180
+ })
181
+ // #endif
182
+ }
183
+ },
32
184
  methods: {
33
185
  addStyle,
34
186
  getPx,
35
- // 拖动过程中触发
187
+ init() {
188
+ if (this.isRange) {
189
+ this.updateValue(this.rangeValue[0], false, 0);
190
+ this.updateValue(this.rangeValue[1], false, 1);
191
+ } else {
192
+ // #ifdef VUE3
193
+ this.updateValue(this.modelValue, false);
194
+ // #endif
195
+ // #ifdef VUE2
196
+ this.updateValue(this.value, false);
197
+ // #endif
198
+ }
199
+ },
200
+ // native拖动过程中触发
36
201
  changingHandler(e) {
37
202
  const {
38
203
  value
@@ -47,7 +212,7 @@
47
212
  // 触发事件
48
213
  this.$emit('changing', value)
49
214
  },
50
- // 滑动结束时触发
215
+ // native滑动结束时触发
51
216
  changeHandler(e) {
52
217
  const {
53
218
  value
@@ -60,12 +225,216 @@
60
225
  this.$emit("input", value);
61
226
  // #endif
62
227
  // 触发事件
63
- this.$emit('change', value)
228
+ this.$emit('change', value);
229
+ },
230
+ onTouchStart(event, index = 1) {
231
+ if (this.disabled) return;
232
+ this.startX = 0;
233
+ // 触摸点集
234
+ let touches = event.touches[0];
235
+ // 触摸点到屏幕左边的距离
236
+ this.startX = touches.clientX;
237
+ // 此处的this.modelValue虽为props值,但是通过$emit('update:modelValue')进行了修改
238
+ if (this.isRange) {
239
+ this.startValue0 = this.format(this.rangeValue[0], 0);
240
+ this.startValue = this.format(this.rangeValue[1], 1);
241
+ } else {
242
+ // #ifdef VUE3
243
+ this.startValue = this.format(this.modelValue);
244
+ // #endif
245
+ // #ifdef VUE2
246
+ this.startValue = this.format(this.value);
247
+ // #endif
248
+ }
249
+ // 标示当前的状态为开始触摸滑动
250
+ this.status = 'start';
251
+ },
252
+ onTouchMove(event, index = 1) {
253
+ if (this.disabled) return;
254
+ // 连续触摸的过程会一直触发本方法,但只有手指触发且移动了才被认为是拖动了,才发出事件
255
+ // 触摸后第一次移动已经将status设置为moving状态,故触摸第二次移动不会触发本事件
256
+ if (this.status == 'start') this.$emit('start');
257
+ let touches = event.touches[0];
258
+ // console.log('touchs', touches)
259
+ // 滑块的左边不一定跟屏幕左边接壤,所以需要减去最外层父元素的左边值
260
+ let clientX = 0;
261
+ // #ifndef APP-NVUE
262
+ clientX = touches.clientX;
263
+ // #endif
264
+ // #ifdef APP-NVUE
265
+ clientX = touches.screenX;
266
+ // #endif
267
+ this.distanceX = clientX - this.sliderRect.left;
268
+ // 获得移动距离对整个滑块的值,此为带有多位小数的值,不能用此更新视图
269
+ // 否则造成通信阻塞,需要每改变一个step值时修改一次视图
270
+ this.newValue = ((this.distanceX / this.sliderRect.width) * (this.max - this.min)) + parseFloat(this.min);
271
+ this.status = 'moving';
272
+ // 发出moving事件
273
+ this.$emit('changing');
274
+ this.updateValue(this.newValue, true, index);
275
+ },
276
+ onTouchEnd(event, index = 1) {
277
+ if (this.disabled) return;
278
+ if (this.status === 'moving') {
279
+ this.updateValue(this.newValue, false, index);
280
+ this.$emit('change');
281
+ }
282
+ this.status = 'end';
283
+ },
284
+ updateValue(value, drag, index = 1) {
285
+ // 去掉小数部分,同时也是对step步进的处理
286
+ let valueFormat = this.format(value, index);
287
+ // 不允许滑动的值超过max最大值
288
+ if(valueFormat > this.max ) {
289
+ valueFormat = this.max
290
+ }
291
+ // 设置移动的距离,不能用百分比,因为NVUE不支持。
292
+ let width = Math.min((valueFormat - this.min) / (this.max - this.min) * this.sliderRect.width, this.sliderRect.width)
293
+ let barStyle = {
294
+ width: width + 'px'
295
+ };
296
+ // 移动期间无需过渡动画
297
+ if (drag == true) {
298
+ barStyle.transition = 'none';
299
+ } else {
300
+ // 非移动期间,删掉对过渡为空的声明,让css中的声明起效
301
+ delete barStyle.transition;
302
+ }
303
+ // 修改value值
304
+ if (this.isRange) {
305
+ this.rangeValue[index] = valueFormat;
306
+ this.$emit("update:modelValue", this.rangeValue);
307
+ } else {
308
+ // #ifdef VUE3
309
+ this.$emit("update:modelValue", valueFormat);
310
+ // #endif
311
+ // #ifdef VUE2
312
+ this.$emit("input", valueFormat);
313
+ // #endif
314
+ }
315
+
316
+ switch (index) {
317
+ case 0:
318
+ this.barStyle0 = {...barStyle};
319
+ break;
320
+ case 1:
321
+ this.barStyle = {...barStyle};
322
+ break;
323
+ default:
324
+ break;
325
+ }
326
+
327
+ },
328
+ format(value, index = 1) {
329
+ // 将小数变成整数,为了减少对视图的更新,造成视图层与逻辑层的阻塞
330
+ if (this.isRange) {
331
+ switch (index) {
332
+ case 0:
333
+ return Math.round(
334
+ Math.max(this.min, Math.min(value, this.rangeValue[1] - this.step,this.max))
335
+ / this.step
336
+ ) * this.step;
337
+ break;
338
+ case 1:
339
+ return Math.round(
340
+ Math.max(this.min, this.rangeValue[0] + this.step, Math.min(value, this.max))
341
+ / this.step
342
+ ) * this.step;
343
+ break;
344
+ default:
345
+ break;
346
+ }
347
+ } else {
348
+ return Math.round(
349
+ Math.max(this.min, Math.min(value, this.max))
350
+ / this.step
351
+ ) * this.step;
352
+ }
353
+ },
354
+ onClick(event) {
355
+ if (this.disabled) return;
356
+ // 直接点击滑块的情况,计算方式与onTouchMove方法相同
357
+ const value = ((event.detail.x - this.sliderRect.left) / this.sliderRect.width) * 100;
358
+ this.updateValue(value, false);
64
359
  }
65
- },
360
+ }
66
361
  }
67
362
  </script>
68
363
 
69
364
  <style lang="scss" scoped>
70
365
  @import "../../libs/css/components.scss";
366
+ .u-slider {
367
+ position: relative;
368
+ display: flex;
369
+ flex-direction: row;
370
+ align-items: center;
371
+
372
+ &__native {
373
+ flex: 1;
374
+ }
375
+
376
+ &-inner {
377
+ flex: 1;
378
+ position: relative;
379
+ border-radius: 999px;
380
+ padding: 10px 18px;
381
+ justify-content: center;
382
+ }
383
+
384
+ &__show-value {
385
+ margin: 10px 18px 10px 0px;
386
+ }
387
+
388
+ &__show-range-value {
389
+ padding-top: 2px;
390
+ font-size: 12px;
391
+ line-height: 12px;
392
+ position: absolute;
393
+ bottom: 0;
394
+ }
395
+
396
+ &__base {
397
+ background-color: #ebedf0;
398
+ }
399
+
400
+ /* #ifndef APP-NVUE */
401
+ &-inner:before {
402
+ position: absolute;
403
+ right: 0;
404
+ left: 0;
405
+ content: '';
406
+ top: -8px;
407
+ bottom: -8px;
408
+ z-index: -1;
409
+ }
410
+ /* #endif */
411
+
412
+ &__gap {
413
+ position: relative;
414
+ border-radius: 999px;
415
+ transition: width 0.2s;
416
+ background-color: #1989fa;
417
+ }
418
+
419
+ &__button {
420
+ width: 24px;
421
+ height: 24px;
422
+ border-radius: 50%;
423
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
424
+ background-color: #fff;
425
+ transform: scale(0.9);
426
+ /* #ifdef H5 */
427
+ cursor: pointer;
428
+ /* #endif */
429
+ }
430
+
431
+ &__button-wrap {
432
+ position: absolute;
433
+ // transform: translate3d(50%, -50%, 0);
434
+ }
435
+
436
+ &--disabled {
437
+ opacity: 0.5;
438
+ }
439
+ }
71
440
  </style>
@@ -200,12 +200,7 @@
200
200
  // #endif
201
201
  }
202
202
  },
203
- // #ifdef VUE2
204
- beforeDestroy() {
205
- // #endif
206
- // #ifdef VUE3
207
203
  beforeUnmount() {
208
- // #endif
209
204
  this.disconnectObserver('contentObserver')
210
205
  }
211
206
  }
@@ -167,12 +167,7 @@ export default {
167
167
  getContentRef() {
168
168
  return this.$refs['u-swipe-action-item__content'].ref
169
169
  },
170
- // #ifdef VUE2
171
- beforeDestroy() {
172
- // #endif
173
- // #ifdef VUE3
174
170
  beforeUnmount() {
175
- // #endif
176
171
  this.unbindBindingX()
177
172
  }
178
173
  }