uview-plus 3.3.41 → 3.3.42

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,9 +1,11 @@
1
+ ## 3.3.42(2024-11-15)
2
+ add: button组件支持stop参数阻止冒泡
3
+
1
4
  ## 3.3.41(2024-11-13)
2
5
  fix: u-radio-group invalid import
3
6
 
4
7
  improvement: 优化图片组件宽高及修复事件event传递
5
8
 
6
-
7
9
  ## 3.3.40(2024-11-11)
8
10
  add: 组件radioGroup增加gap属性用于设置item间隔
9
11
 
@@ -37,6 +37,7 @@ export default {
37
37
  text: '',
38
38
  icon: '',
39
39
  iconColor: '',
40
- color: ''
40
+ color: '',
41
+ stop: true,
41
42
  }
42
43
  }
@@ -149,6 +149,11 @@ export const props = defineMixin({
149
149
  color: {
150
150
  type: String,
151
151
  default: () => defProps.button.color
152
- }
152
+ },
153
+ // 停止冒泡
154
+ stop: {
155
+ type: Boolean,
156
+ default: () => defProps.button.stop
157
+ },
153
158
  }
154
159
  })
@@ -271,7 +271,7 @@ export default {
271
271
  'error', 'opensetting', 'launchapp', 'agreeprivacyauthorization'],
272
272
  methods: {
273
273
  addStyle,
274
- clickHandler() {
274
+ clickHandler(e: any) {
275
275
  // 非禁止并且非加载中,才能点击
276
276
  if (!this.disabled && !this.loading) {
277
277
  // 进行节流控制,每this.throttle毫秒内,只在开始处执行
@@ -279,6 +279,8 @@ export default {
279
279
  this.$emit("click");
280
280
  }, this.throttleTime);
281
281
  }
282
+ // 是否阻止事件传播
283
+ this.stop && this.preventEvent(e)
282
284
  },
283
285
  // 下面为对接uniapp官方按钮开放能力事件回调的对接
284
286
  getphonenumber(res: any) {
@@ -0,0 +1,122 @@
1
+ <template>
2
+ <view
3
+ class="u-float-button" :class="class">
4
+ <view class="u-float-button__main" @click.stop="clickHandler" :style="{
5
+ backgroundColor: backgroundColor,
6
+ color: color,
7
+ flexDirection: 'row',
8
+ justifyContent: 'center',
9
+ alignItems: 'center',
10
+ width: width,
11
+ height: height,
12
+ position: 'absolute',
13
+ bottom: bottom,
14
+ right: right,
15
+ borderRadius: '50%',
16
+ borderColor: borderColor,
17
+ }">
18
+ <slot :showList="showList">
19
+ <up-icon :class="{'show-list': showList}" name="plus" :color="color"></up-icon>
20
+ </slot>
21
+ <slot name="list">
22
+ <view class="u-float-button__list" :style="{
23
+ bottom: bottom,
24
+ right: right
25
+ }">
26
+ <template v-for="item in list">
27
+ <view class="u-float-button__item" :style="{
28
+ backgroundColor: item?.bgColor || bgColor,
29
+ color: item?.color || color,
30
+ flexDirection: 'row',
31
+ justifyContent: 'center',
32
+ alignItems: 'center',
33
+ width: width,
34
+ height: height,
35
+ borderRadius: '50%',
36
+ borderColor: item?.borderColor || borderColor,
37
+ }" @click="itemClick(item, index)">
38
+ <up-icon :name="item.name" :color="item?.color || color"></up-icon>
39
+ </view>
40
+ </template>
41
+ </view>
42
+ </slot>
43
+ </view>
44
+ </view>
45
+ </template>
46
+
47
+ <script>
48
+ import { mpMixin } from '../../libs/mixin/mpMixin';
49
+ import { mixin } from '../../libs/mixin/mixin';
50
+ import { addStyle, addUnit, deepMerge } from '../../libs/function/index';
51
+ /**
52
+ * FloatButton 悬浮按钮
53
+ * @description 悬浮按钮常用于屏幕右下角点击展开的操作菜单
54
+ * @tutorial https://ijry.github.io/uview-plus/components/floatButton.html
55
+ * @property {String} bgColor 背景颜色
56
+ * @event {Function} click 点击触发事件
57
+ * @example <up-view></up-view>
58
+ */
59
+ export default {
60
+ name: 'u-float-button',
61
+ // #ifdef MP
62
+ mixins: [mpMixin, mixin],
63
+ // #endif
64
+ // #ifndef MP
65
+ mixins: [mpMixin, mixin],
66
+ // #endif
67
+ emits: ['click', 'item-click'],
68
+ computed: {
69
+ valueStyle() {}
70
+ },
71
+ props: {
72
+ bgColor: '#2979ff',
73
+ color: '#fff',
74
+ width: '50px',
75
+ height: '50px',
76
+ borderColor: '',
77
+ right: '80px',
78
+ bottom: '100px',
79
+ isMenu: false
80
+ },
81
+ data() {
82
+ return {
83
+ showList: false
84
+ }
85
+ },
86
+ methods: {
87
+ addStyle,
88
+ clickHandler(e) {
89
+ if (this.isMenu) {
90
+ this.showList = !this.showList
91
+ } else {
92
+ this.$emit('click', e)
93
+ }
94
+ },
95
+ itemClick(item, index) {
96
+ this.$emit('item-click', {
97
+ ...item,
98
+ index
99
+ })
100
+ }
101
+ }
102
+ }
103
+ </script>
104
+
105
+ <style lang="scss" scoped>
106
+ @import '../../libs/css/components.scss';
107
+
108
+ .u-float-button {
109
+ .show-list {
110
+ transform: rotate(45deg);
111
+ }
112
+ &__list {
113
+ position: absolute;
114
+ bottom: 0px;
115
+ display: flex;
116
+ flex-direction: column;
117
+ >view {
118
+ margin: 5px 0px;
119
+ }
120
+ }
121
+ }
122
+ </style>
@@ -274,7 +274,7 @@
274
274
  // 触摸后第一次移动已经将status设置为moving状态,故触摸第二次移动不会触发本事件
275
275
  if (this.status == 'start') this.$emit('start');
276
276
  let touches = event.touches[0];
277
- console.log('touchs', touches)
277
+ // console.log('touchs', touches)
278
278
  // 滑块的左边不一定跟屏幕左边接壤,所以需要减去最外层父元素的左边值
279
279
  let clientX = 0;
280
280
  // #ifndef APP-NVUE
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.3.41",
5
+ "version": "3.3.42",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",