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
@@ -32,8 +32,8 @@
32
32
  * @property {Boolean | Number} use-anchor 是否使用锚点链接
33
33
  * @event {Function} load dom 结构加载完毕时触发
34
34
  * @event {Function} ready 所有图片加载完毕时触发
35
- * @event {Function} imgtap 图片被点击时触发
36
- * @event {Function} linktap 链接被点击时触发
35
+ * @event {Function} imgTap 图片被点击时触发
36
+ * @event {Function} linkTap 链接被点击时触发
37
37
  * @event {Function} play 音视频播放时触发
38
38
  * @event {Function} error 媒体加载出错时触发
39
39
  */
@@ -410,7 +410,7 @@ export default {
410
410
  break
411
411
  // 图片点击
412
412
  case 'onImgTap':
413
- this.$emit('imgtTap', message.attrs)
413
+ this.$emit('imgTap', message.attrs)
414
414
  if (this.previewImg) {
415
415
  uni.previewImage({
416
416
  current: parseInt(message.attrs.i),
@@ -1,306 +1,307 @@
1
- <template>
2
- <view class="u-popup">
3
- <u-overlay
4
- :show="show"
5
- @click="overlayClick"
6
- v-if="overlay"
7
- :duration="overlayDuration"
8
- :customStyle="overlayStyle"
9
- :opacity="overlayOpacity"
10
- ></u-overlay>
11
- <u-transition
12
- :show="show"
13
- :customStyle="transitionStyle"
14
- :mode="position"
15
- :duration="duration"
16
- @afterEnter="afterEnter"
17
- @click="clickHandler"
18
- >
19
- <view
20
- class="u-popup__content"
21
- :style="[contentStyle]"
22
- @tap.stop="noop"
23
- >
24
- <u-status-bar v-if="safeAreaInsetTop"></u-status-bar>
25
- <slot></slot>
26
- <view
27
- v-if="closeable"
28
- @tap.stop="close"
29
- class="u-popup__content__close"
30
- :class="['u-popup__content__close--' + closeIconPos]"
31
- hover-class="u-popup__content__close--hover"
32
- hover-stay-time="150"
33
- >
34
- <u-icon
35
- name="close"
36
- color="#909399"
37
- size="18"
38
- bold
39
- ></u-icon>
40
- </view>
41
- <u-safe-bottom v-if="safeAreaInsetBottom"></u-safe-bottom>
42
- </view>
43
- </u-transition>
44
- </view>
45
- </template>
46
-
47
- <script>
48
- import props from './props.js';
49
- import mpMixin from '../../libs/mixin/mpMixin.js';
50
- import mixin from '../../libs/mixin/mixin.js';
51
-
52
- /**
53
- * popup 弹窗
54
- * @description 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义
55
- * @tutorial https://ijry.github.io/uview-plus/components/popup.html
56
- * @property {Boolean} show 是否展示弹窗 (默认 false )
57
- * @property {Boolean} overlay 是否显示遮罩 (默认 true )
58
- * @property {String} mode 弹出方向(默认 'bottom' )
59
- * @property {String | Number} duration 动画时长,单位ms (默认 300 )
60
- * @property {String | Number} overlayDuration 遮罩层动画时长,单位ms (默认 350 )
61
- * @property {Boolean} closeable 是否显示关闭图标(默认 false )
62
- * @property {Object | String} overlayStyle 自定义遮罩的样式
63
- * @property {String | Number} overlayOpacity 遮罩透明度,0-1之间(默认 0.5)
64
- * @property {Boolean} closeOnClickOverlay 点击遮罩是否关闭弹窗 (默认 true )
65
- * @property {String | Number} zIndex 层级 (默认 10075 )
66
- * @property {Boolean} safeAreaInsetBottom 是否为iPhoneX留出底部安全距离 (默认 true )
67
- * @property {Boolean} safeAreaInsetTop 是否留出顶部安全距离(状态栏高度) (默认 false )
68
- * @property {String} closeIconPos 自定义关闭图标位置(默认 'top-right' )
69
- * @property {String | Number} round 圆角值(默认 0)
70
- * @property {Boolean} zoom 当mode=center时 是否开启缩放(默认 true )
71
- * @property {Object} customStyle 组件的样式,对象形式
72
- * @event {Function} open 弹出层打开
73
- * @event {Function} close 弹出层收起
74
- * @example <u-popup v-model="show"><text>出淤泥而不染,濯清涟而不妖</text></u-popup>
75
- */
76
- export default {
77
- name: 'u-popup',
78
- mixins: [mpMixin, mixin, props],
79
- data() {
80
- return {
81
- overlayDuration: this.duration + 50
82
- }
83
- },
84
- watch: {
85
- show(newValue, oldValue) {
86
- if (newValue === true) {
87
- // #ifdef MP-WEIXIN
88
- const children = this.$children
89
- this.retryComputedComponentRect(children)
90
- // #endif
91
- }
92
- }
93
- },
94
- computed: {
95
- transitionStyle() {
96
- const style = {
97
- zIndex: this.zIndex,
98
- position: 'fixed',
99
- display: 'flex',
100
- }
101
- style[this.mode] = 0
102
- if (this.mode === 'left') {
103
- return uni.$u.deepMerge(style, {
104
- bottom: 0,
105
- top: 0,
106
- })
107
- } else if (this.mode === 'right') {
108
- return uni.$u.deepMerge(style, {
109
- bottom: 0,
110
- top: 0,
111
- })
112
- } else if (this.mode === 'top') {
113
- return uni.$u.deepMerge(style, {
114
- left: 0,
115
- right: 0
116
- })
117
- } else if (this.mode === 'bottom') {
118
- return uni.$u.deepMerge(style, {
119
- left: 0,
120
- right: 0,
121
- })
122
- } else if (this.mode === 'center') {
123
- return uni.$u.deepMerge(style, {
124
- alignItems: 'center',
125
- 'justify-content': 'center',
126
- top: 0,
127
- left: 0,
128
- right: 0,
129
- bottom: 0
130
- })
131
- }
132
- },
133
- contentStyle() {
134
- const style = {}
135
- // 通过设备信息的safeAreaInsets值来判断是否需要预留顶部状态栏和底部安全局的位置
136
- // 不使用css方案,是因为nvue不支持css的iPhoneX安全区查询属性
137
- const {
138
- safeAreaInsets
139
- } = uni.$u.sys()
140
- if (this.mode !== 'center') {
141
- style.flex = 1
142
- }
143
- // 背景色,一般用于设置为transparent,去除默认的白色背景
144
- if (this.bgColor) {
145
- style.backgroundColor = this.bgColor
146
- }
147
- if(this.round) {
148
- const value = uni.$u.addUnit(this.round)
149
- if(this.mode === 'top') {
150
- style.borderBottomLeftRadius = value
151
- style.borderBottomRightRadius = value
152
- } else if(this.mode === 'bottom') {
153
- style.borderTopLeftRadius = value
154
- style.borderTopRightRadius = value
155
- } else if(this.mode === 'center') {
156
- style.borderRadius = value
157
- }
158
- }
159
- return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
160
- },
161
- position() {
162
- if (this.mode === 'center') {
163
- return this.zoom ? 'fade-zoom' : 'fade'
164
- }
165
- if (this.mode === 'left') {
166
- return 'slide-left'
167
- }
168
- if (this.mode === 'right') {
169
- return 'slide-right'
170
- }
171
- if (this.mode === 'bottom') {
172
- return 'slide-up'
173
- }
174
- if (this.mode === 'top') {
175
- return 'slide-down'
176
- }
177
- },
178
- },
179
- methods: {
180
- // 点击遮罩
181
- overlayClick() {
182
- if (this.closeOnClickOverlay) {
183
- this.$emit('close')
184
- }
185
- },
186
- close(e) {
187
- this.$emit('close')
188
- },
189
- afterEnter() {
190
- this.$emit('open')
191
- },
192
- clickHandler() {
193
- // 由于中部弹出时,其u-transition占据了整个页面相当于遮罩,此时需要发出遮罩点击事件,是否无法通过点击遮罩关闭弹窗
194
- if(this.mode === 'center') {
195
- this.overlayClick()
196
- }
197
- this.$emit('click')
198
- },
199
- // #ifdef MP-WEIXIN
200
- retryComputedComponentRect(children) {
201
- // 组件内部需要计算节点的组件
202
- const names = ['u-calendar-month', 'u-album', 'u-collapse-item', 'u-dropdown', 'u-index-item', 'u-index-list',
203
- 'u-line-progress', 'u-list-item', 'u-rate', 'u-read-more', 'u-row', 'u-row-notice', 'u-scroll-list',
204
- 'u-skeleton', 'u-slider', 'u-steps-item', 'u-sticky', 'u-subsection', 'u-swipe-action-item', 'u-tabbar',
205
- 'u-tabs', 'u-tooltip'
206
- ]
207
- // 历遍所有的子组件节点
208
- for (let i = 0; i < children.length; i++) {
209
- const child = children[i]
210
- // 拿到子组件的子组件
211
- const grandChild = child.$children
212
- // 判断如果在需要重新初始化的组件数组中名中,并且存在init方法的话,则执行
213
- if (names.includes(child.$options.name) && typeof child?.init === 'function') {
214
- // 需要进行一定的延时,因为初始化页面需要时间
215
- uni.$u.sleep(50).then(() => {
216
- child.init()
217
- })
218
- }
219
- // 如果子组件还有孙组件,进行递归历遍
220
- if (grandChild.length) {
221
- this.retryComputedComponentRect(grandChild)
222
- }
223
- }
224
- }
225
- // #endif
226
- }
227
- }
228
- </script>
229
-
230
- <style lang="scss" scoped>
231
- @import "../../libs/css/components.scss";
232
- $u-popup-flex:1 !default;
233
- $u-popup-content-background-color: #fff !default;
234
-
235
- .u-popup {
236
- flex: $u-popup-flex;
237
-
238
- &__content {
239
- background-color: $u-popup-content-background-color;
240
- position: relative;
241
-
242
- &--round-top {
243
- border-top-left-radius: 0;
244
- border-top-right-radius: 0;
245
- border-bottom-left-radius: 10px;
246
- border-bottom-right-radius: 10px;
247
- }
248
-
249
- &--round-left {
250
- border-top-left-radius: 0;
251
- border-top-right-radius: 10px;
252
- border-bottom-left-radius: 0;
253
- border-bottom-right-radius: 10px;
254
- }
255
-
256
- &--round-right {
257
- border-top-left-radius: 10px;
258
- border-top-right-radius: 0;
259
- border-bottom-left-radius: 10px;
260
- border-bottom-right-radius: 0;
261
- }
262
-
263
- &--round-bottom {
264
- border-top-left-radius: 10px;
265
- border-top-right-radius: 10px;
266
- border-bottom-left-radius: 0;
267
- border-bottom-right-radius: 0;
268
- }
269
-
270
- &--round-center {
271
- border-top-left-radius: 10px;
272
- border-top-right-radius: 10px;
273
- border-bottom-left-radius: 10px;
274
- border-bottom-right-radius: 10px;
275
- }
276
-
277
- &__close {
278
- position: absolute;
279
-
280
- &--hover {
281
- opacity: 0.4;
282
- }
283
- }
284
-
285
- &__close--top-left {
286
- top: 15px;
287
- left: 15px;
288
- }
289
-
290
- &__close--top-right {
291
- top: 15px;
292
- right: 15px;
293
- }
294
-
295
- &__close--bottom-left {
296
- bottom: 15px;
297
- left: 15px;
298
- }
299
-
300
- &__close--bottom-right {
301
- right: 15px;
302
- bottom: 15px;
303
- }
304
- }
305
- }
306
- </style>
1
+ <template>
2
+ <view class="u-popup">
3
+ <u-overlay
4
+ :show="show"
5
+ @click="overlayClick"
6
+ v-if="overlay"
7
+ :duration="overlayDuration"
8
+ :customStyle="overlayStyle"
9
+ :opacity="overlayOpacity"
10
+ ></u-overlay>
11
+ <u-transition
12
+ :show="show"
13
+ :customStyle="transitionStyle"
14
+ :mode="position"
15
+ :duration="duration"
16
+ @afterEnter="afterEnter"
17
+ @click="clickHandler"
18
+ >
19
+ <view
20
+ class="u-popup__content"
21
+ :style="[contentStyle]"
22
+ @tap.stop="noop"
23
+ >
24
+ <u-status-bar v-if="safeAreaInsetTop"></u-status-bar>
25
+ <slot></slot>
26
+ <view
27
+ v-if="closeable"
28
+ @tap.stop="close"
29
+ class="u-popup__content__close"
30
+ :class="['u-popup__content__close--' + closeIconPos]"
31
+ hover-class="u-popup__content__close--hover"
32
+ hover-stay-time="150"
33
+ >
34
+ <u-icon
35
+ name="close"
36
+ color="#909399"
37
+ size="18"
38
+ bold
39
+ ></u-icon>
40
+ </view>
41
+ <u-safe-bottom v-if="safeAreaInsetBottom"></u-safe-bottom>
42
+ </view>
43
+ </u-transition>
44
+ </view>
45
+ </template>
46
+
47
+ <script>
48
+ import props from './props.js';
49
+ import mpMixin from '../../libs/mixin/mpMixin.js';
50
+ import mixin from '../../libs/mixin/mixin.js';
51
+
52
+ /**
53
+ * popup 弹窗
54
+ * @description 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义
55
+ * @tutorial https://ijry.github.io/uview-plus/components/popup.html
56
+ * @property {Boolean} show 是否展示弹窗 (默认 false )
57
+ * @property {Boolean} overlay 是否显示遮罩 (默认 true )
58
+ * @property {String} mode 弹出方向(默认 'bottom' )
59
+ * @property {String | Number} duration 动画时长,单位ms (默认 300 )
60
+ * @property {String | Number} overlayDuration 遮罩层动画时长,单位ms (默认 350 )
61
+ * @property {Boolean} closeable 是否显示关闭图标(默认 false )
62
+ * @property {Object | String} overlayStyle 自定义遮罩的样式
63
+ * @property {String | Number} overlayOpacity 遮罩透明度,0-1之间(默认 0.5)
64
+ * @property {Boolean} closeOnClickOverlay 点击遮罩是否关闭弹窗 (默认 true )
65
+ * @property {String | Number} zIndex 层级 (默认 10075 )
66
+ * @property {Boolean} safeAreaInsetBottom 是否为iPhoneX留出底部安全距离 (默认 true )
67
+ * @property {Boolean} safeAreaInsetTop 是否留出顶部安全距离(状态栏高度) (默认 false )
68
+ * @property {String} closeIconPos 自定义关闭图标位置(默认 'top-right' )
69
+ * @property {String | Number} round 圆角值(默认 0)
70
+ * @property {Boolean} zoom 当mode=center时 是否开启缩放(默认 true )
71
+ * @property {Object} customStyle 组件的样式,对象形式
72
+ * @event {Function} open 弹出层打开
73
+ * @event {Function} close 弹出层收起
74
+ * @example <u-popup v-model="show"><text>出淤泥而不染,濯清涟而不妖</text></u-popup>
75
+ */
76
+ export default {
77
+ name: 'u-popup',
78
+ mixins: [mpMixin, mixin, props],
79
+ data() {
80
+ return {
81
+ overlayDuration: this.duration + 50
82
+ }
83
+ },
84
+ watch: {
85
+ show(newValue, oldValue) {
86
+ if (newValue === true) {
87
+ // #ifdef MP-WEIXIN
88
+ const children = this.$children
89
+ this.retryComputedComponentRect(children)
90
+ // #endif
91
+ }
92
+ }
93
+ },
94
+ computed: {
95
+ transitionStyle() {
96
+ const style = {
97
+ zIndex: this.zIndex,
98
+ position: 'fixed',
99
+ display: 'flex',
100
+ }
101
+ style[this.mode] = 0
102
+ if (this.mode === 'left') {
103
+ return uni.$u.deepMerge(style, {
104
+ bottom: 0,
105
+ top: 0,
106
+ })
107
+ } else if (this.mode === 'right') {
108
+ return uni.$u.deepMerge(style, {
109
+ bottom: 0,
110
+ top: 0,
111
+ })
112
+ } else if (this.mode === 'top') {
113
+ return uni.$u.deepMerge(style, {
114
+ left: 0,
115
+ right: 0
116
+ })
117
+ } else if (this.mode === 'bottom') {
118
+ return uni.$u.deepMerge(style, {
119
+ left: 0,
120
+ right: 0,
121
+ })
122
+ } else if (this.mode === 'center') {
123
+ return uni.$u.deepMerge(style, {
124
+ alignItems: 'center',
125
+ 'justify-content': 'center',
126
+ top: 0,
127
+ left: 0,
128
+ right: 0,
129
+ bottom: 0
130
+ })
131
+ }
132
+ },
133
+ contentStyle() {
134
+ const style = {}
135
+ // 通过设备信息的safeAreaInsets值来判断是否需要预留顶部状态栏和底部安全局的位置
136
+ // 不使用css方案,是因为nvue不支持css的iPhoneX安全区查询属性
137
+ const {
138
+ safeAreaInsets
139
+ } = uni.$u.sys()
140
+ if (this.mode !== 'center') {
141
+ style.flex = 1
142
+ }
143
+ // 背景色,一般用于设置为transparent,去除默认的白色背景
144
+ if (this.bgColor) {
145
+ style.backgroundColor = this.bgColor
146
+ }
147
+ if(this.round) {
148
+ const value = uni.$u.addUnit(this.round)
149
+ if(this.mode === 'top') {
150
+ style.borderBottomLeftRadius = value
151
+ style.borderBottomRightRadius = value
152
+ } else if(this.mode === 'bottom') {
153
+ style.borderTopLeftRadius = value
154
+ style.borderTopRightRadius = value
155
+ } else if(this.mode === 'center') {
156
+ style.borderRadius = value
157
+ }
158
+ }
159
+ return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
160
+ },
161
+ position() {
162
+ if (this.mode === 'center') {
163
+ return this.zoom ? 'fade-zoom' : 'fade'
164
+ }
165
+ if (this.mode === 'left') {
166
+ return 'slide-left'
167
+ }
168
+ if (this.mode === 'right') {
169
+ return 'slide-right'
170
+ }
171
+ if (this.mode === 'bottom') {
172
+ return 'slide-up'
173
+ }
174
+ if (this.mode === 'top') {
175
+ return 'slide-down'
176
+ }
177
+ },
178
+ },
179
+ emits: ["open", "close", "click"],
180
+ methods: {
181
+ // 点击遮罩
182
+ overlayClick() {
183
+ if (this.closeOnClickOverlay) {
184
+ this.$emit('close')
185
+ }
186
+ },
187
+ close(e) {
188
+ this.$emit('close')
189
+ },
190
+ afterEnter() {
191
+ this.$emit('open')
192
+ },
193
+ clickHandler() {
194
+ // 由于中部弹出时,其u-transition占据了整个页面相当于遮罩,此时需要发出遮罩点击事件,是否无法通过点击遮罩关闭弹窗
195
+ if(this.mode === 'center') {
196
+ this.overlayClick()
197
+ }
198
+ this.$emit('click')
199
+ },
200
+ // #ifdef MP-WEIXIN
201
+ retryComputedComponentRect(children) {
202
+ // 组件内部需要计算节点的组件
203
+ const names = ['u-calendar-month', 'u-album', 'u-collapse-item', 'u-dropdown', 'u-index-item', 'u-index-list',
204
+ 'u-line-progress', 'u-list-item', 'u-rate', 'u-read-more', 'u-row', 'u-row-notice', 'u-scroll-list',
205
+ 'u-skeleton', 'u-slider', 'u-steps-item', 'u-sticky', 'u-subsection', 'u-swipe-action-item', 'u-tabbar',
206
+ 'u-tabs', 'u-tooltip'
207
+ ]
208
+ // 历遍所有的子组件节点
209
+ for (let i = 0; i < children.length; i++) {
210
+ const child = children[i]
211
+ // 拿到子组件的子组件
212
+ const grandChild = child.$children
213
+ // 判断如果在需要重新初始化的组件数组中名中,并且存在init方法的话,则执行
214
+ if (names.includes(child.$options.name) && typeof child?.init === 'function') {
215
+ // 需要进行一定的延时,因为初始化页面需要时间
216
+ uni.$u.sleep(50).then(() => {
217
+ child.init()
218
+ })
219
+ }
220
+ // 如果子组件还有孙组件,进行递归历遍
221
+ if (grandChild.length) {
222
+ this.retryComputedComponentRect(grandChild)
223
+ }
224
+ }
225
+ }
226
+ // #endif
227
+ }
228
+ }
229
+ </script>
230
+
231
+ <style lang="scss" scoped>
232
+ @import "../../libs/css/components.scss";
233
+ $u-popup-flex:1 !default;
234
+ $u-popup-content-background-color: #fff !default;
235
+
236
+ .u-popup {
237
+ flex: $u-popup-flex;
238
+
239
+ &__content {
240
+ background-color: $u-popup-content-background-color;
241
+ position: relative;
242
+
243
+ &--round-top {
244
+ border-top-left-radius: 0;
245
+ border-top-right-radius: 0;
246
+ border-bottom-left-radius: 10px;
247
+ border-bottom-right-radius: 10px;
248
+ }
249
+
250
+ &--round-left {
251
+ border-top-left-radius: 0;
252
+ border-top-right-radius: 10px;
253
+ border-bottom-left-radius: 0;
254
+ border-bottom-right-radius: 10px;
255
+ }
256
+
257
+ &--round-right {
258
+ border-top-left-radius: 10px;
259
+ border-top-right-radius: 0;
260
+ border-bottom-left-radius: 10px;
261
+ border-bottom-right-radius: 0;
262
+ }
263
+
264
+ &--round-bottom {
265
+ border-top-left-radius: 10px;
266
+ border-top-right-radius: 10px;
267
+ border-bottom-left-radius: 0;
268
+ border-bottom-right-radius: 0;
269
+ }
270
+
271
+ &--round-center {
272
+ border-top-left-radius: 10px;
273
+ border-top-right-radius: 10px;
274
+ border-bottom-left-radius: 10px;
275
+ border-bottom-right-radius: 10px;
276
+ }
277
+
278
+ &__close {
279
+ position: absolute;
280
+
281
+ &--hover {
282
+ opacity: 0.4;
283
+ }
284
+ }
285
+
286
+ &__close--top-left {
287
+ top: 15px;
288
+ left: 15px;
289
+ }
290
+
291
+ &__close--top-right {
292
+ top: 15px;
293
+ right: 15px;
294
+ }
295
+
296
+ &__close--bottom-left {
297
+ bottom: 15px;
298
+ left: 15px;
299
+ }
300
+
301
+ &__close--bottom-right {
302
+ right: 15px;
303
+ bottom: 15px;
304
+ }
305
+ }
306
+ }
307
+ </style>
@@ -180,7 +180,7 @@
180
180
  mounted() {
181
181
  this.init()
182
182
  },
183
-
183
+ emits: ["change"],
184
184
  methods: {
185
185
  init() {
186
186
  // 支付宝小程序不支持provide/inject,所以使用这个方法获取整个父组件,在created定义,避免循环引用
@@ -90,6 +90,7 @@
90
90
  mounted() {
91
91
  this.init()
92
92
  },
93
+ emits: ["open", "close"],
93
94
  methods: {
94
95
  async init() {
95
96
  this.getContentHeight().then(height => {
@@ -60,6 +60,7 @@
60
60
  return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
61
61
  }
62
62
  },
63
+ emits: ["click"],
63
64
  methods: {
64
65
  clickHandler(e) {
65
66
  this.$emit('click')