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
@@ -1,129 +1,127 @@
1
- <template>
2
- <view class="u-drawdown">
3
- <view
4
- class="u-dropdown__menu"
5
- :style="{
6
- height: $u.addUnit(height)
7
- }"
8
- ref="u-dropdown__menu"
9
- >
10
- <view
11
- class="u-dropdown__menu__item"
12
- v-for="(item, index) in menuList"
13
- :key="index"
14
- @tap.stop="clickHandler(item, index)"
15
- >
16
- <view class="u-dropdown__menu__item__content">
17
- <text
18
- class="u-dropdown__menu__item__content__text"
19
- :style="[index === current ? activeStyle : inactiveStyle]"
20
- >{{item.title}}</text>
21
- <view
22
- class="u-dropdown__menu__item__content__arrow"
23
- :class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"
24
- >
25
- <u-icon
26
- :name="menuIcon"
27
- :size="$u.addUnit(menuIconSize)"
28
- ></u-icon>
29
- </view>
30
- </view>
31
- </view>
32
- </view>
33
- <view class="u-dropdown__content">
34
- <slot />
35
- </view>
36
- </view>
37
- </template>
38
-
39
- <script>
40
- import props from './props.js';
41
- import mpMixin from '../../libs/mixin/mpMixin.js';
42
- import mixin from '../../libs/mixin/mixin.js';
43
- /**
44
- * Dropdown
45
- * @description
46
- * @tutorial url
47
- * @property {String}
48
- * @event {Function}
49
- * @example
50
- */
51
- export default {
52
- name: 'u-dropdown',
53
- mixins: [mixin, props],
54
- data() {
55
- return {
56
- // �˵�����
57
- menuList: [],
58
- current: 0
59
- }
60
- },
61
- computed: {
62
-
63
- },
64
- created() {
65
- // �������������(u-dropdown-item)��this��������data������������������΢��С��������ѭ�����ö�����
66
- this.children = [];
67
- },
68
- methods: {
69
- clickHandler(item, index) {
70
- this.children.map(child => {
71
- if(child.title === item.title) {
72
- // this.queryRect('u-dropdown__menu').then(size => {
73
- child.$emit('click')
74
- child.setContentAnimate(child.show ? 0 : 300)
75
- child.show = !child.show
76
- // })
77
- } else {
78
- child.show = false
79
- child.setContentAnimate(0)
80
- }
81
- })
82
- },
83
- // ��ȡ��ǩ�ijߴ�λ��
84
- queryRect(el) {
85
- // #ifndef APP-NVUE
86
- // $uGetRectΪuView�Դ��Ľڵ��ѯ�򻯷���https://ijry.github.io/uview-plus/.uviewui.com/js/getRect.html
87
- // ����ڲ�һ����this.$uGetRect�������Ϊthis.$u.getRect�����߹���һ�£����Ʋ�ͬ
88
- return new Promise(resolve => {
89
- this.$uGetRect(`.${el}`).then(size => {
90
- resolve(size)
91
- })
92
- })
93
- // #endif
94
-
95
- // #ifdef APP-NVUE
96
- // nvue�£�ʹ��domģ���ѯԪ�ظ߶�
97
- // ����һ��promise���õ��ô˷�����������ʹ��then�ص�
98
- return new Promise(resolve => {
99
- dom.getComponentRect(this.$refs[el], res => {
100
- resolve(res.size)
101
- })
102
- })
103
- // #endif
104
- },
105
- },
106
- }
107
- </script>
108
-
109
- <style lang="scss">
110
- @import '../../libs/css/components.scss';
111
-
112
- .u-dropdown {
113
-
114
- &__menu {
115
- @include flex;
116
-
117
- &__item {
118
- flex: 1;
119
- @include flex;
120
- justify-content: center;
121
-
122
- &__content {
123
- @include flex;
124
- align-items: center;
125
- }
126
- }
127
- }
128
- }
129
- </style>
1
+ <template>
2
+ <view class="u-drawdown">
3
+ <view
4
+ class="u-dropdown__menu"
5
+ :style="{
6
+ height: $u.addUnit(height)
7
+ }"
8
+ ref="u-dropdown__menu"
9
+ >
10
+ <view
11
+ class="u-dropdown__menu__item"
12
+ v-for="(item, index) in menuList"
13
+ :key="index"
14
+ @tap.stop="clickHandler(item, index)"
15
+ >
16
+ <view class="u-dropdown__menu__item__content">
17
+ <text
18
+ class="u-dropdown__menu__item__content__text"
19
+ :style="[index === current ? activeStyle : inactiveStyle]"
20
+ >{{item.title}}</text>
21
+ <view
22
+ class="u-dropdown__menu__item__content__arrow"
23
+ :class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"
24
+ >
25
+ <u-icon
26
+ :name="menuIcon"
27
+ :size="$u.addUnit(menuIconSize)"
28
+ ></u-icon>
29
+ </view>
30
+ </view>
31
+ </view>
32
+ </view>
33
+ <view class="u-dropdown__content">
34
+ <slot />
35
+ </view>
36
+ </view>
37
+ </template>
38
+
39
+ <script>
40
+ import props from './props.js';
41
+ import mpMixin from '../../libs/mixin/mpMixin.js';
42
+ import mixin from '../../libs/mixin/mixin.js';
43
+ /**
44
+ * Dropdown
45
+ * @description
46
+ * @tutorial url
47
+ * @property {String}
48
+ * @event {Function}
49
+ * @example
50
+ */
51
+ export default {
52
+ name: 'u-dropdown',
53
+ mixins: [mixin, props],
54
+ data() {
55
+ return {
56
+ menuList: [],
57
+ current: 0
58
+ }
59
+ },
60
+ computed: {
61
+
62
+ },
63
+ created() {
64
+ this.children = [];
65
+ },
66
+ emits: ["click"],
67
+ methods: {
68
+ clickHandler(item, index) {
69
+ this.children.map(child => {
70
+ if(child.title === item.title) {
71
+ // this.queryRect('u-dropdown__menu').then(size => {
72
+ child.$emit('click')
73
+ child.setContentAnimate(child.show ? 0 : 300)
74
+ child.show = !child.show
75
+ // })
76
+ } else {
77
+ child.show = false
78
+ child.setContentAnimate(0)
79
+ }
80
+ })
81
+ },
82
+ //
83
+ queryRect(el) {
84
+ // #ifndef APP-NVUE
85
+ // $uGetRect?uView https://ijry.github.io/uview-plus/.uviewui.com/js/getRect.html
86
+ // this.$uGetRect this.$u.getRect
87
+ return new Promise(resolve => {
88
+ this.$uGetRect(`.${el}`).then(size => {
89
+ resolve(size)
90
+ })
91
+ })
92
+ // #endif
93
+
94
+ // #ifdef APP-NVUE
95
+ // promisethen
96
+ return new Promise(resolve => {
97
+ dom.getComponentRect(this.$refs[el], res => {
98
+ resolve(res.size)
99
+ })
100
+ })
101
+ // #endif
102
+ },
103
+ },
104
+ }
105
+ </script>
106
+
107
+ <style lang="scss">
108
+ @import '../../libs/css/components.scss';
109
+
110
+ .u-dropdown {
111
+
112
+ &__menu {
113
+ @include flex;
114
+
115
+ &__item {
116
+ flex: 1;
117
+ @include flex;
118
+ justify-content: center;
119
+
120
+ &__content {
121
+ @include flex;
122
+ align-items: center;
123
+ }
124
+ }
125
+ }
126
+ }
127
+ </style>
@@ -123,6 +123,7 @@
123
123
  mounted() {
124
124
  this.init()
125
125
  },
126
+ emits: ["click"],
126
127
  methods: {
127
128
  init() {
128
129
  // 父组件的实例
@@ -70,7 +70,7 @@
70
70
  /**
71
71
  * Image 图片
72
72
  * @description 此组件为uni-app的image组件的加强版,在继承了原有功能外,还支持淡入动画、加载中、加载失败提示、圆角值和形状等。
73
- * @tutorial https://uviewui.com/components/image.html
73
+ * @tutorial https://uiadmin.net/uview-plus/components/image.html
74
74
  * @property {String} src 图片地址
75
75
  * @property {String} mode 裁剪模式,见官网说明 (默认 'aspectFill' )
76
76
  * @property {String | Number} width 宽度,单位任意,如果为数值,则为px单位 (默认 '300' )
@@ -33,7 +33,7 @@
33
33
  /**
34
34
  * IndexAnchor 列表锚点
35
35
  * @description
36
- * @tutorial https://uviewui.com/components/indexList.html
36
+ * @tutorial https://uiadmin.net/uview-plus/components/indexList.html
37
37
  * @property {String | Number} text 列表锚点文本内容
38
38
  * @property {String} color 列表锚点文字颜色 ( 默认 '#606266' )
39
39
  * @property {String | Number} size 列表锚点文字大小,单位默认px ( 默认 14 )
@@ -25,7 +25,7 @@
25
25
  /**
26
26
  * IndexItem
27
27
  * @description
28
- * @tutorial https://uviewui.com/components/indexList.html
28
+ * @tutorial https://uiadmin.net/uview-plus/components/indexList.html
29
29
  * @property {String}
30
30
  * @event {Function}
31
31
  * @example
@@ -110,7 +110,7 @@
110
110
  /**
111
111
  * IndexList 索引列表
112
112
  * @description 通过折叠面板收纳内容区域
113
- * @tutorial https://uviewui.com/components/indexList.html
113
+ * @tutorial https://uiadmin.net/uview-plus/components/indexList.html
114
114
  * @property {String} inactiveColor 右边锚点非激活的颜色 ( 默认 '#606266' )
115
115
  * @property {String} activeColor 右边锚点激活的颜色 ( 默认 '#5677fc' )
116
116
  * @property {Array} indexList 索引字符列表,数组形式
@@ -81,7 +81,7 @@ import mixin from '../../libs/mixin/mixin.js';
81
81
  /**
82
82
  * Input 输入框
83
83
  * @description 此组件为一个输入框,默认没有边框和样式,是专门为配合表单组件u-form而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。
84
- * @tutorial https://uviewui.com/components/input.html
84
+ * @tutorial https://uiadmin.net/uview-plus/components/input.html
85
85
  * @property {String | Number} value 输入的值
86
86
  * @property {String} type 输入框类型,见上方说明 ( 默认 'text' )
87
87
  * @property {Boolean} fixed 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 ( 默认 false )
@@ -271,8 +271,8 @@ export default {
271
271
  },
272
272
  // 键盘高度发生变化的时候触发此事件
273
273
  // 兼容性:微信小程序2.7.0+、App 3.1.0+
274
- onkeyboardheightchange() {
275
- this.$emit("keyboardheightchange");
274
+ onkeyboardheightchange(event) {
275
+ this.$emit("keyboardheightchange", event);
276
276
  },
277
277
  // 内容发生变化,进行处理
278
278
  valueChange() {
@@ -106,6 +106,7 @@
106
106
  }
107
107
  },
108
108
  mixins: [mpMixin, mixin, props],
109
+ emits: ["change", "close", "confirm", "cancel", "backspace"],
109
110
  methods: {
110
111
  change(e) {
111
112
  this.$emit('change', e);
@@ -45,6 +45,7 @@
45
45
  return style
46
46
  }
47
47
  },
48
+ emits: ["click"],
48
49
  methods: {
49
50
  openLink() {
50
51
  // #ifdef APP-PLUS
@@ -104,6 +104,7 @@
104
104
  this.anchors = []
105
105
  },
106
106
  mounted() {},
107
+ emits: ["scroll", "scrolltolower", "scrolltoupper"],
107
108
  methods: {
108
109
  updateOffsetFromChild(top) {
109
110
  this.offset = top
@@ -110,6 +110,7 @@
110
110
  return text;
111
111
  }
112
112
  },
113
+ emits: ["loadmore"],
113
114
  methods: {
114
115
  loadMore() {
115
116
  // 只有在“加载更多”的状态下才发送点击事件,内容不满一屏时无法触发底部上拉事件,所以需要点击来触发