uview-plus 3.3.39 → 3.3.41

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,5 +1,17 @@
1
+ ## 3.3.41(2024-11-13)
2
+ fix: u-radio-group invalid import
3
+
4
+ improvement: 优化图片组件宽高及修复事件event传递
5
+
6
+
7
+ ## 3.3.40(2024-11-11)
8
+ add: 组件radioGroup增加gap属性用于设置item间隔
9
+
10
+ fix: 修复H5全局导入
11
+
1
12
  ## 3.3.39(2024-11-04)
2
13
  fix: 修复相册组件
14
+
3
15
  ## 3.3.38(2024-11-04)
4
16
  fix: 修复视频预览报错 #510
5
17
 
@@ -107,7 +107,7 @@
107
107
  if(!this.keepRunning || !this.timer) return
108
108
  // 记录当前的时间戳,为了下次进入页面,如果还在倒计时内的话,继续倒计时
109
109
  // 倒计时尚未结束,结果大于0;倒计时已经开始,就会小于初始值,如果等于初始值,说明没有开始倒计时,无需处理
110
- if(this.secNum > 0 && this.secNum < this.seconds) {
110
+ if(this.secNum > 0 && this.secNum <= this.seconds) {
111
111
  // 获取当前时间戳(+ new Date()为特殊写法),除以1000变成秒,再去除小数部分
112
112
  let nowTimestamp = Math.floor((+ new Date()) / 1000)
113
113
  // 将本该结束时候的时间戳保存起来 => 当前时间戳 + 剩余的秒数
@@ -2,6 +2,7 @@
2
2
  <u-transition
3
3
  mode="fade"
4
4
  :show="show"
5
+ :style="transStyle"
5
6
  :duration="fade ? 1000 : 0"
6
7
  >
7
8
  <view
@@ -129,6 +130,13 @@
129
130
  }
130
131
  },
131
132
  computed: {
133
+ transStyle() {
134
+ let style = {};
135
+ // 通过调用addUnit()方法,如果有单位,如百分比,px单位等,直接返回,如果是纯粹的数值,则加上rpx单位
136
+ style.width = addUnit(this.width);
137
+ style.height = addUnit(this.height);
138
+ return style;
139
+ },
132
140
  wrapStyle() {
133
141
  let style = {};
134
142
  // 通过调用addUnit()方法,如果有单位,如百分比,px单位等,直接返回,如果是纯粹的数值,则加上rpx单位
@@ -156,8 +164,8 @@
156
164
  methods: {
157
165
  addUnit,
158
166
  // 点击图片
159
- onClick() {
160
- this.$emit('click')
167
+ onClick(e) {
168
+ this.$emit('click', e)
161
169
  },
162
170
  // 图片加载失败
163
171
  onErrorHandler(err) {
@@ -192,7 +200,7 @@
192
200
  removeBgColor() {
193
201
  // 淡入动画过渡完成后,将背景设置为透明色,否则png图片会看到灰色的背景
194
202
  this.backgroundStyle = {
195
- backgroundColor: 'transparent'
203
+ backgroundColor: this.bgColor || '#ffffff'
196
204
  };
197
205
  }
198
206
  }
@@ -90,6 +90,11 @@ export const props = defineMixin({
90
90
  iconPlacement: {
91
91
  type: String,
92
92
  default: () => defProps.radio.iconPlacement
93
- }
93
+ },
94
+ // item 之间的间距
95
+ gap: {
96
+ type: [String, Number],
97
+ default: () => defProps.radioGroup.gap
98
+ }
94
99
  }
95
100
  })
@@ -3,8 +3,8 @@
3
3
  * @Description :
4
4
  * @version : 1.0
5
5
  * @Date : 2021-08-20 16:44:21
6
- * @LastAuthor : LQ
7
- * @lastTime : 2021-08-20 17:03:12
6
+ * @LastAuthor : CPS
7
+ * @lastTime : 2024-11-05 16:01:12
8
8
  * @FilePath : /u-view2.0/uview-ui/libs/config/props/radioGroup.js
9
9
  */
10
10
  export default {
@@ -25,6 +25,7 @@ export default {
25
25
  iconColor: '#ffffff',
26
26
  iconSize: 12,
27
27
  borderBottom: false,
28
- iconPlacement: 'left'
28
+ iconPlacement: 'left',
29
+ gap: "10px"
29
30
  }
30
31
  }
@@ -2,6 +2,7 @@
2
2
  <view
3
3
  class="u-radio-group"
4
4
  :class="bemClass"
5
+ :style="radioGroupStyle"
5
6
  >
6
7
  <slot></slot>
7
8
  </view>
@@ -11,6 +12,7 @@
11
12
  import { props } from './props';
12
13
  import { mpMixin } from '../../libs/mixin/mpMixin';
13
14
  import { mixin } from '../../libs/mixin/mixin';
15
+ import { addUnit, addStyle, deepMerge } from '../../libs/function/index';
14
16
 
15
17
  /**
16
18
  * radioRroup 单选框父组件
@@ -32,7 +34,8 @@
32
34
  * @property {String | Number} iconSize 图标的大小,单位px (默认 12 )
33
35
  * @property {Boolean} borderBottom placement为row时,是否显示下边框 (默认 false )
34
36
  * @property {String} iconPlacement 图标与文字的对齐方式 (默认 'left' )
35
- * @property {Object} customStyle 组件的样式,对象形式
37
+ * @property {Object} gap item 之间的间距
38
+ * @property {Object} customStyle 组件的样式,对象形式
36
39
  * @event {Function} change 任一个radio状态发生变化时触发
37
40
  * @example <u-radio-group v-model="value"></u-radio-group>
38
41
  */
@@ -60,6 +63,12 @@
60
63
  // this.bem为一个computed变量,在mixin中
61
64
  return this.bem('radio-group', ['placement'])
62
65
  },
66
+ radioGroupStyle() {
67
+ const style = {
68
+ gap: addUnit(this.gap)
69
+ };
70
+ return deepMerge(style, addStyle(this.customStyle));
71
+ }
63
72
  },
64
73
  watch: {
65
74
  // 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <view
3
+ class="u-view" :class="class" :style="{
4
+ backgroundColor: backgroundColor,
5
+ color: color,
6
+ flexDirection: flexDirection,
7
+ justifyContent: justifyContent,
8
+ alignItems: alignItems,
9
+ flex1: flex1,
10
+ width: width,
11
+ height: height,
12
+ padding: padding,
13
+ margin: margin,
14
+ borderColor: borderColor,
15
+ }">
16
+ </view>
17
+ </template>
18
+
19
+ <script>
20
+ import { mpMixin } from '../../libs/mixin/mpMixin';
21
+ import { mixin } from '../../libs/mixin/mixin';
22
+ import { addStyle, addUnit, deepMerge } from '../../libs/function/index';
23
+ /**
24
+ * View 视图
25
+ * @description 对View默认标签的封装
26
+ * @tutorial https://ijry.github.io/uview-plus/components/view.html
27
+ * @property {String} bgColor 背景颜色
28
+ * @event {Function} click 点击触发事件
29
+ * @example <up-view></up-view>
30
+ */
31
+ export default {
32
+ name: 'up-view',
33
+ // #ifdef MP
34
+ mixins: [mpMixin, mixin],
35
+ // #endif
36
+ // #ifndef MP
37
+ mixins: [mpMixin, mixin],
38
+ // #endif
39
+ emits: ['click'],
40
+ computed: {
41
+ valueStyle() {}
42
+ },
43
+ props: {
44
+ backgroundColor: '',
45
+ color: '',
46
+ flexDirection: '',
47
+ justifyContent: '',
48
+ alignItems: '',
49
+ flex1: '',
50
+ width: '',
51
+ height: '',
52
+ padding: '',
53
+ margin: '',
54
+ borderColor: ''
55
+ },
56
+ data() {
57
+ return {}
58
+ },
59
+ methods: {
60
+ addStyle,
61
+ clickHandler() {
62
+ this.$emit('click')
63
+ }
64
+ }
65
+ }
66
+ </script>
67
+
68
+ <style lang="scss" scoped>
69
+ @import '../../libs/css/components.scss';
70
+
71
+ .u-view {
72
+ }
73
+ </style>
package/index.js CHANGED
@@ -89,7 +89,6 @@ let components = [];
89
89
  for (const key in importFn) {
90
90
  let component = importFn[key].default;
91
91
  if (component.name && component.name.indexOf('u--') !== 0) {
92
- const name = component.name.replace(/u-([a-zA-Z0-9-_]+)/g, 'up-$1');
93
92
  component.install = function (Vue) {
94
93
  Vue.component(name, component);
95
94
  };
@@ -111,7 +110,8 @@ function toCamelCase(str) {
111
110
  const install = (Vue) => {
112
111
  // #ifdef H5
113
112
  components.forEach(function(component) {
114
- Vue.component(component.name, component);
113
+ const name = component.name.replace(/u-([a-zA-Z0-9-_]+)/g, 'up-$1');
114
+ Vue.component(name, component);
115
115
  });
116
116
  // #endif
117
117
 
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.39",
5
+ "version": "3.3.41",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",