uview-plus 3.4.106 → 3.4.107

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,6 @@
1
+ ## 3.4.107(2025-08-20)
2
+ feat: input组件支持密码显示切换
3
+
1
4
  ## 3.4.106(2025-08-20)
2
5
  feat: tooltip组件支持左右方向弹窗
3
6
 
@@ -3,9 +3,9 @@
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:13:55
8
- * @FilePath : /u-view2.0/uview-ui/libs/config/props/input.js
6
+ * @LastAuthor : jry
7
+ * @lastTime : 2025-08-20 10:21:55
8
+ * @FilePath : /uview-plus/libs/config/props/input.js
9
9
  */
10
10
  export default {
11
11
  // index 组件
@@ -44,6 +44,7 @@ export default {
44
44
  readonly: false,
45
45
  shape: 'square',
46
46
  formatter: null,
47
- cursorColor: ''
47
+ cursorColor: '',
48
+ passwordVisibilityToggle: true
48
49
  }
49
50
  }
@@ -199,5 +199,10 @@ export const props = defineMixin({
199
199
  type: String,
200
200
  default: () => defProps.input.cursorColor
201
201
  },
202
+ // 密码类型可见性切换
203
+ passwordVisibilityToggle: {
204
+ type: Boolean,
205
+ default: () => defProps.input.passwordVisibilityToggle
206
+ }
202
207
  }
203
208
  })
@@ -21,7 +21,7 @@
21
21
  ref="input-native"
22
22
  class="u-input__content__field-wrapper__field"
23
23
  :style="[inputStyle]"
24
- :type="type"
24
+ :type="showPassword && 'password' == type ? 'text' : type"
25
25
  :focus="focus"
26
26
  :cursor="cursor"
27
27
  :value="innerValue"
@@ -39,7 +39,7 @@
39
39
  :adjust-position="adjustPosition"
40
40
  :selection-end="selectionEnd"
41
41
  :selection-start="selectionStart"
42
- :password="password || type === 'password' || false"
42
+ :password="isPassword"
43
43
  :ignoreCompositionEvent="ignoreCompositionEvent"
44
44
  @input="onInput"
45
45
  @blur="onBlur"
@@ -61,6 +61,15 @@
61
61
  customStyle="line-height: 12px"
62
62
  ></up-icon>
63
63
  </view>
64
+ <view
65
+ class="u-input__content__subfix-password-shower"
66
+ v-if="(type == 'password' || password) && passwordVisibilityToggle"
67
+ >
68
+ <up-icon @click="showPassword = !showPassword"
69
+ :name="showPassword ? 'eye-off' : 'eye-fill'"
70
+ size="18"
71
+ ></up-icon>
72
+ </view>
64
73
  <view
65
74
  class="u-input__content__subfix-icon"
66
75
  v-if="suffixIcon || $slots.suffix"
@@ -142,7 +151,8 @@ export default {
142
151
  // value绑定值的变化是由内部还是外部引起的
143
152
  changeFromInner: false,
144
153
  // 过滤处理方法
145
- innerFormatter: value => value
154
+ innerFormatter: value => value,
155
+ showPassword: false
146
156
  };
147
157
  },
148
158
  created() {
@@ -178,6 +188,21 @@ export default {
178
188
  }
179
189
  },
180
190
  computed: {
191
+ // 是否密码
192
+ isPassword() {
193
+ let ret = false;
194
+ if(this.password) {
195
+ ret = true;
196
+ } else if (this.type == 'password') {
197
+ ret = true;
198
+ } else {
199
+ ret = false;
200
+ }
201
+ if (this.showPassword) {
202
+ ret = false;
203
+ }
204
+ return ret;
205
+ },
181
206
  // 是否显示清除控件
182
207
  isShowClear() {
183
208
  const { clearable, readonly, focused, innerValue } = this;
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.106",
5
+ "version": "3.4.107",
6
6
  "description": "零云®uview-plus已兼容vue3,100+全面的组件和便捷的工具会让您信手拈来。近期新增拖动排序、条码、图片裁剪、下拉刷新、虚拟列表、签名、Markdown等。",
7
7
  "keywords": [
8
8
  "uview",