uview-plus 3.1.36 → 3.1.37

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 (63) hide show
  1. package/changelog.md +2 -0
  2. package/components/u-action-sheet/u-action-sheet.vue +1 -0
  3. package/components/u-album/u-album.vue +1 -0
  4. package/components/u-alert/u-alert.vue +1 -0
  5. package/components/u-avatar/u-avatar.vue +1 -0
  6. package/components/u-avatar-group/u-avatar-group.vue +1 -0
  7. package/components/u-back-top/u-back-top.vue +2 -1
  8. package/components/u-badge/u-badge.vue +1 -1
  9. package/components/u-calendar/u-calendar.vue +1 -0
  10. package/components/u-car-keyboard/u-car-keyboard.vue +312 -311
  11. package/components/u-cell/u-cell.vue +1 -1
  12. package/components/u-cell-group/u-cell-group.vue +1 -1
  13. package/components/u-checkbox/u-checkbox.vue +2 -1
  14. package/components/u-code/u-code.vue +1 -0
  15. package/components/u-code-input/props.js +13 -5
  16. package/components/u-code-input/u-code-input.vue +8 -2
  17. package/components/u-col/u-col.vue +1 -0
  18. package/components/u-collapse/u-collapse.vue +1 -0
  19. package/components/u-column-notice/u-column-notice.vue +1 -0
  20. package/components/u-count-down/u-count-down.vue +164 -163
  21. package/components/u-count-to/u-count-to.vue +1 -0
  22. package/components/u-divider/u-divider.vue +1 -0
  23. package/components/u-dropdown/u-dropdown.vue +127 -129
  24. package/components/u-form-item/u-form-item.vue +1 -0
  25. package/components/u-image/u-image.vue +1 -1
  26. package/components/u-index-anchor/u-index-anchor.vue +1 -1
  27. package/components/u-index-item/u-index-item.vue +1 -1
  28. package/components/u-index-list/u-index-list.vue +1 -1
  29. package/components/u-input/u-input.vue +3 -3
  30. package/components/u-keyboard/u-keyboard.vue +1 -0
  31. package/components/u-link/u-link.vue +1 -0
  32. package/components/u-list/u-list.vue +1 -0
  33. package/components/u-loadmore/u-loadmore.vue +1 -0
  34. package/components/u-modal/u-modal.vue +230 -229
  35. package/components/u-navbar/u-navbar.vue +1 -1
  36. package/components/u-no-network/u-no-network.vue +1 -0
  37. package/components/u-notice-bar/u-notice-bar.vue +1 -0
  38. package/components/u-number-box/u-number-box.vue +1 -1
  39. package/components/u-number-keyboard/u-number-keyboard.vue +1 -1
  40. package/components/u-overlay/u-overlay.vue +1 -0
  41. package/components/u-parse/node/node.vue +2 -2
  42. package/components/u-parse/parser.js +1333 -1333
  43. package/components/u-parse/u-parse.vue +3 -3
  44. package/components/u-popup/u-popup.vue +307 -306
  45. package/components/u-radio/u-radio.vue +1 -1
  46. package/components/u-read-more/u-read-more.vue +1 -0
  47. package/components/u-row/u-row.vue +1 -0
  48. package/components/u-row-notice/u-row-notice.vue +1 -0
  49. package/components/u-scroll-list/u-scroll-list.vue +1 -0
  50. package/components/u-search/u-search.vue +6 -2
  51. package/components/u-slider/props.js +13 -5
  52. package/components/u-slider/u-slider.vue +66 -55
  53. package/components/u-status-bar/u-status-bar.vue +1 -1
  54. package/components/u-steps/u-steps.vue +1 -1
  55. package/components/u-steps-item/u-steps-item.vue +1 -1
  56. package/components/u-subsection/u-subsection.vue +1 -0
  57. package/components/u-swiper/u-swiper.vue +10 -9
  58. package/components/u-tabbar-item/u-tabbar-item.vue +1 -0
  59. package/components/u-tag/u-tag.vue +362 -361
  60. package/components/u-toolbar/u-toolbar.vue +1 -0
  61. package/components/u-tooltip/u-tooltip.vue +1 -0
  62. package/components/u-upload/u-upload.vue +1 -1
  63. package/package.json +1 -1
@@ -166,6 +166,7 @@
166
166
 
167
167
  this.init()
168
168
  },
169
+ emits: ["click", "close"],
169
170
  methods: {
170
171
  init() {
171
172
  // #ifdef APP-NVUE
@@ -147,6 +147,7 @@ export default {
147
147
  mounted() {
148
148
  this.init()
149
149
  },
150
+ emits: ["left", "right"],
150
151
  methods: {
151
152
  init() {
152
153
  this.getComponentWidth()
@@ -212,8 +212,12 @@
212
212
  if (this.disabled) this.$emit('click');
213
213
  },
214
214
  // 点击左边图标
215
- clickIcon() {
216
- this.$emit('clickIcon');
215
+ clickIcon(e) {
216
+ this.$emit('clickIcon', this.keyword);
217
+ try {
218
+ // 收起键盘
219
+ uni.hideKeyboard();
220
+ } catch (e) {}
217
221
  }
218
222
  }
219
223
  }
@@ -16,11 +16,19 @@ export default {
16
16
  type: [Number, String],
17
17
  default: defprops.slider.step
18
18
  },
19
- // 当前取值
20
- value: {
21
- type: [Number, String],
22
- default: defprops.slider.value
23
- },
19
+ // #ifdef VUE3
20
+ // 当前取值
21
+ modelValue: {
22
+ type: [String, Number],
23
+ default: defprops.slider.value
24
+ },
25
+ // #endif
26
+ // #ifdef VUE2
27
+ // 当前取值
28
+ value: {
29
+ type: [String, Number],
30
+ default: defprops.slider.value
31
+ },
24
32
  // 滑块右侧已选择部分的背景色
25
33
  activeColor: {
26
34
  type: String,
@@ -1,57 +1,68 @@
1
- <template>
2
- <view
3
- class="u-slider"
4
- :style="[$u.addStyle(customStyle)]"
5
- >
6
- <slider
7
- :min="min"
8
- :max="max"
9
- :step="step"
10
- :value="value"
11
- :activeColor="activeColor"
12
- :inactiveColor="inactiveColor"
13
- :blockSize="$u.getPx(blockSize)"
14
- :blockColor="blockColor"
15
- :showValue="showValue"
16
- :disabled="disabled"
17
- @changing="changingHandler"
18
- @change="changeHandler"
19
- ></slider>
20
- </view>
21
- </template>
22
-
23
- <script>
1
+ <template>
2
+ <view
3
+ class="u-slider"
4
+ :style="[$u.addStyle(customStyle)]"
5
+ >
6
+ <slider
7
+ :min="min"
8
+ :max="max"
9
+ :step="step"
10
+ :value="value"
11
+ :activeColor="activeColor"
12
+ :backgroundColor="inactiveColor"
13
+ :blockSize="$u.getPx(blockSize)"
14
+ :blockColor="blockColor"
15
+ :showValue="showValue"
16
+ :disabled="disabled"
17
+ @changing="changingHandler"
18
+ @change="changeHandler"
19
+ ></slider>
20
+ </view>
21
+ </template>
22
+
23
+ <script>
24
24
  import props from './props.js';
25
25
  import mpMixin from '../../libs/mixin/mpMixin.js';
26
- import mixin from '../../libs/mixin/mixin.js';
27
- export default {
28
- name: 'u--slider',
29
- mixins: [mpMixin, mixin, props],
30
- methods: {
31
- // 拖动过程中触发
32
- changingHandler(e) {
33
- const {
34
- value
35
- } = e.detail
36
- // 更新v-model的值
37
- this.$emit('input', value)
38
- // 触发事件
39
- this.$emit('changing', value)
40
- },
41
- // 滑动结束时触发
42
- changeHandler(e) {
43
- const {
44
- value
45
- } = e.detail
46
- // 更新v-model的值
47
- this.$emit('input', value)
48
- // 触发事件
49
- this.$emit('change', value)
50
- }
51
- },
52
- }
53
- </script>
54
-
55
- <style lang="scss" scoped>
56
- @import "../../libs/css/components.scss";
57
- </style>
26
+ import mixin from '../../libs/mixin/mixin.js';
27
+ export default {
28
+ name: 'u--slider',
29
+ mixins: [mpMixin, mixin, props],
30
+ emits: ["changing", "change"],
31
+ methods: {
32
+ // 拖动过程中触发
33
+ changingHandler(e) {
34
+ const {
35
+ value
36
+ } = e.detail
37
+ // 更新v-model的值
38
+ // #ifdef VUE3
39
+ this.$emit("update:modelValue", value);
40
+ // #endif
41
+ // #ifdef VUE2
42
+ this.$emit("input", value);
43
+ // #endif
44
+ // 触发事件
45
+ this.$emit('changing', value)
46
+ },
47
+ // 滑动结束时触发
48
+ changeHandler(e) {
49
+ const {
50
+ value
51
+ } = e.detail
52
+ // 更新v-model的值
53
+ // #ifdef VUE3
54
+ this.$emit("update:modelValue", value);
55
+ // #endif
56
+ // #ifdef VUE2
57
+ this.$emit("input", value);
58
+ // #endif
59
+ // 触发事件
60
+ this.$emit('change', value)
61
+ }
62
+ },
63
+ }
64
+ </script>
65
+
66
+ <style lang="scss" scoped>
67
+ @import "../../libs/css/components.scss";
68
+ </style>
@@ -14,7 +14,7 @@
14
14
  /**
15
15
  * StatbusBar 状态栏占位
16
16
  * @description 本组件主要用于状态填充,比如在自定导航栏的时候,它会自动适配一个恰当的状态栏高度。
17
- * @tutorial https://uviewui.com/components/statusBar.html
17
+ * @tutorial https://uiadmin.net/uview-plus/components/statusBar.html
18
18
  * @property {String} bgColor 背景色 (默认 'transparent' )
19
19
  * @property {String | Object} customStyle 自定义样式
20
20
  * @example <u-status-bar></u-status-bar>
@@ -14,7 +14,7 @@
14
14
  /**
15
15
  * Steps 步骤条
16
16
  * @description 该组件一般用于完成一个任务要分几个步骤,标识目前处于第几步的场景。
17
- * @tutorial https://uviewui.com/components/steps.html
17
+ * @tutorial https://uiadmin.net/uview-plus/components/steps.html
18
18
  * @property {String} direction row-横向,column-竖向 (默认 'row' )
19
19
  * @property {String | Number} current 设置当前处于第几步 (默认 0 )
20
20
  * @property {String} activeColor 激活状态颜色 (默认 '#3c9cff' )
@@ -56,7 +56,7 @@
56
56
  /**
57
57
  * StepsItem 步骤条的子组件
58
58
  * @description 本组件需要和u-steps配合使用
59
- * @tutorial https://uviewui.com/components/steps.html
59
+ * @tutorial https://uiadmin.net/uview-plus/components/steps.html
60
60
  * @property {String} title 标题文字
61
61
  * @property {String} current 描述文本
62
62
  * @property {String | Number} iconSize 图标大小 (默认 17 )
@@ -176,6 +176,7 @@ export default {
176
176
  mounted() {
177
177
  this.init();
178
178
  },
179
+ emits: ["change"],
179
180
  methods: {
180
181
  init() {
181
182
  uni.$u.sleep().then(() => this.getRect());
@@ -139,6 +139,7 @@
139
139
  this.currentIndex = val; // 和上游数据关联上
140
140
  }
141
141
  },
142
+ emits: ["click", "change"],
142
143
  computed: {
143
144
  itemStyle() {
144
145
  return index => {
@@ -156,15 +157,15 @@
156
157
  }
157
158
  },
158
159
  methods: {
159
- getItemType(item) {
160
- if (typeof item === 'string') return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
161
- if (typeof item === 'object' && this.keyName) {
162
- if (!item.type) return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
163
- if (item.type === 'image') return 'image'
164
- if (item.type === 'video') return 'video'
165
- return 'image'
166
- }
167
- },
160
+ getItemType(item) {
161
+ if (typeof item === 'string') return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
162
+ if (typeof item === 'object' && this.keyName) {
163
+ if (!item.type) return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
164
+ if (item.type === 'image') return 'image'
165
+ if (item.type === 'video') return 'video'
166
+ return 'image'
167
+ }
168
+ },
168
169
  // 获取目标路径,可能数组中为字符串,对象的形式,额外可指定对象的目标属性名keyName
169
170
  getSource(item) {
170
171
  if (typeof item === 'string') return item
@@ -80,6 +80,7 @@
80
80
  created() {
81
81
  this.init()
82
82
  },
83
+ emits: ["click", "change"],
83
84
  methods: {
84
85
  init() {
85
86
  // 支付宝小程序不支持provide/inject,所以使用这个方法获取整个父组件,在created定义,避免循环引用