sadais-piui 1.2.7-beta16 → 1.2.7-beta160

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 (100) hide show
  1. package/.prettierrc +8 -0
  2. package/components/pi-action-sheet/index.vue +260 -247
  3. package/components/pi-badge/index.vue +18 -2
  4. package/components/pi-bottom-bar/index.vue +15 -4
  5. package/components/pi-bubble/index.vue +14 -3
  6. package/components/pi-button/index.vue +16 -3
  7. package/components/pi-calendar/index.vue +207 -182
  8. package/components/pi-calendar-input/index.vue +72 -31
  9. package/components/pi-calendar-panel/components/calendar-days/index.vue +96 -52
  10. package/components/pi-calendar-panel/index.vue +50 -19
  11. package/components/pi-canvas/index.vue +18 -2
  12. package/components/pi-card/index.vue +5 -1
  13. package/components/pi-cascader/index.vue +635 -0
  14. package/components/pi-checkbox/index.vue +8 -4
  15. package/components/pi-checkbox-group/index.vue +12 -11
  16. package/components/pi-circle-progress/index.vue +82 -20
  17. package/components/pi-code-input/index.vue +11 -2
  18. package/components/pi-collapse/index.vue +18 -7
  19. package/components/pi-collapse-item/index.vue +35 -22
  20. package/components/pi-count-up/index.vue +8 -2
  21. package/components/pi-date-picker/index.vue +512 -391
  22. package/components/pi-date-picker-input/index.vue +72 -31
  23. package/components/pi-divider/index.vue +5 -1
  24. package/components/pi-dropdown/components/dropdown-tab.vue +38 -23
  25. package/components/pi-dropdown/index.vue +50 -23
  26. package/components/pi-dropdown-item/index.vue +82 -62
  27. package/components/pi-form/index.vue +8 -2
  28. package/components/pi-form-item/index.vue +90 -20
  29. package/components/pi-grid/index.vue +6 -2
  30. package/components/pi-grid-item/index.vue +17 -8
  31. package/components/pi-icon/index.vue +6 -1
  32. package/components/pi-img/index.vue +275 -267
  33. package/components/pi-img-cropper/canvas.js +10 -3
  34. package/components/pi-img-cropper/index.vue +6 -3
  35. package/components/pi-img-cropper/touch.js +4 -1
  36. package/components/pi-img-cropper/vector.js +2 -2
  37. package/components/pi-input/index.vue +97 -36
  38. package/components/pi-line-progress/index.vue +9 -2
  39. package/components/pi-list/index.vue +5 -1
  40. package/components/pi-list-item/index.vue +9 -4
  41. package/components/pi-loading/index.vue +10 -2
  42. package/components/pi-marquee/index.vue +322 -310
  43. package/components/pi-marquee-pure-css/index.vue +267 -0
  44. package/components/pi-mask/index.vue +3 -1
  45. package/components/pi-modal/index.vue +311 -303
  46. package/components/pi-navbar/index.vue +22 -5
  47. package/components/pi-notify/index.vue +9 -3
  48. package/components/pi-number-keyboard/index.vue +15 -3
  49. package/components/pi-opentype-button/index.vue +11 -3
  50. package/components/pi-pagination/index.vue +18 -1
  51. package/components/pi-picker/index.vue +332 -317
  52. package/components/pi-popup/index.vue +12 -5
  53. package/components/pi-popup-select/index.vue +13 -4
  54. package/components/pi-radio/index.vue +12 -11
  55. package/components/pi-radio-group/index.vue +28 -6
  56. package/components/pi-rate/index.vue +9 -2
  57. package/components/pi-regions-select/index.vue +50 -12
  58. package/components/pi-regions-select-input/index.vue +69 -31
  59. package/components/pi-search/index.vue +37 -2
  60. package/components/pi-section/index.vue +6 -2
  61. package/components/pi-select/index.vue +237 -22
  62. package/components/pi-select-input/index.vue +106 -41
  63. package/components/pi-skeleton/index.vue +2 -1
  64. package/components/pi-status-bar/index.vue +4 -1
  65. package/components/pi-stepper/index.vue +34 -20
  66. package/components/pi-steps/index.vue +56 -13
  67. package/components/pi-subsection/index.vue +10 -5
  68. package/components/pi-swiper/index.vue +21 -7
  69. package/components/pi-switch/index.vue +19 -6
  70. package/components/pi-table/index.vue +351 -0
  71. package/components/pi-tabs/index.vue +87 -20
  72. package/components/pi-tag/index.vue +17 -5
  73. package/components/pi-upload-img/index.vue +854 -46
  74. package/components/pi-waterfall/index.vue +14 -5
  75. package/components/pi-webview/index.vue +95 -82
  76. package/config/actionSheet.js +1 -2
  77. package/config/calendarInput.js +2 -1
  78. package/config/calendarPanel.js +2 -1
  79. package/config/cascader.js +22 -0
  80. package/config/circleProgress.js +32 -4
  81. package/config/codeInput.js +2 -1
  82. package/config/datePicker.js +29 -24
  83. package/config/datePickerInput.js +2 -1
  84. package/config/dropdown.js +3 -1
  85. package/config/input.js +5 -3
  86. package/config/marqueePureCss.js +18 -0
  87. package/config/regionsSelectInput.js +2 -1
  88. package/config/select.js +13 -1
  89. package/config/selectInput.js +2 -1
  90. package/config/table.js +9 -0
  91. package/config/uploadImg.js +55 -11
  92. package/index.js +15 -2
  93. package/mixin/emitter.js +8 -1
  94. package/mixin/page-transitions/index.js +7 -2
  95. package/mixin/value-sync.js +5 -0
  96. package/package.json +5 -2
  97. package/scss/common.scss +11 -14
  98. package/scss/icon/icon.scss +2 -1
  99. package/scss/mixin.scss +5 -5
  100. package/utils/file-utils.js +273 -0
package/.prettierrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "trailingComma": "none",
3
+ "arrowParens": "avoid",
4
+ "bracketSpacing": true,
5
+ "quoteProps": "consistent",
6
+ "semi": false,
7
+ "singleQuote": true
8
+ }
@@ -1,247 +1,260 @@
1
- <template>
2
- <pi-popup-select
3
- :value="val"
4
- :custom-style="getPopupSelect.customStyle"
5
- :custom-class="getPopupSelect.customClass"
6
- :height="getPopupSelect.height"
7
- :show-title="getPopupSelect.showTitle"
8
- :title="getPopupSelect.title"
9
- :title-padding="getPopupSelect.titlePadding"
10
- :toolbar-position="getPopupSelect.toolbarPosition"
11
- :on-confirm-close="getPopupSelect.onConfirmClose"
12
- :on-cancel-close="getPopupSelect.onCancelClose"
13
- :confirm-btn="getPopupSelect.confirmBtn"
14
- :cancel-btn="getPopupSelect.cancelBtn"
15
- :popup="getPopup"
16
- @close="handlePopupClose"
17
- @cancel="handleCancel"
18
- @confirm="handleConfirm"
19
- >
20
- <slot name="header" />
21
- <!-- 描述列 -->
22
- <view
23
- v-if="description"
24
- class="pi-solid-bottom-2 pi-align-center pi-pd-32 pi-light-gray"
25
- :style="[getItemAlignStyle]"
26
- >
27
- {{ description }}
28
- </view>
29
- <view
30
- v-for="item in items"
31
- :id="`id-${item[keyField]}`"
32
- :key="item[keyField]"
33
- :style="[itemStyle, getItemStyle, getItemAlignStyle, { color: item.color }]"
34
- :class="{
35
- 'pi-solid-bottom-1': showItemBottomBorder,
36
- 'pi-disabled': item.disabled
37
- }"
38
- class="pi-align-center pi-fz-30 pi-pd-lr-32"
39
- hover-class="pi-hover-class"
40
- @tap.stop="handleSelectItem(item)"
41
- >
42
- <!-- 自定义列表项 -->
43
- <slot name="item" :item="item" class="pi-w-100P">
44
- <template v-if="!item.loading">
45
- {{ item[displayField] }}
46
- </template>
47
- <pi-loading v-else show />
48
- </slot>
49
- </view>
50
- <!-- 取消action -->
51
- <template v-if="cancelText">
52
- <pi-gap height="20" />
53
- <view
54
- class="pi-align-center pi-fz-30 pi-pd-32 pi-light-gray"
55
- hover-class="pi-hover-class"
56
- :style="[getItemAlignStyle]"
57
- @tap="handleCancel"
58
- >
59
- {{ cancelText }}
60
- </view>
61
- </template>
62
-
63
- <slot name="footer" />
64
- </pi-popup-select>
65
- </template>
66
-
67
- <script>
68
- import ValueSync from '../../mixin/value-sync'
69
- import { getConfig } from '../../config'
70
-
71
- const TAG = 'PiActionSheet'
72
- const { actionSheet } = getConfig()
73
-
74
- const alignFlexMap = {
75
- left: 'flex-start',
76
- center: 'center',
77
- right: 'flex-end'
78
- }
79
-
80
- export default {
81
- name: 'PiActionSheet',
82
- // 混入v-model
83
- mixins: [ValueSync],
84
- props: {
85
- // 初始值
86
- value: {
87
- required: false
88
- },
89
- // 自定义样式
90
- customStyle: {
91
- type: Object,
92
- // {}
93
- default() {
94
- return actionSheet.customStyle
95
- }
96
- },
97
- // 自定义样式类
98
- customClass: {
99
- type: String,
100
- // ''
101
- default() {
102
- return actionSheet.customClass
103
- }
104
- },
105
- // 选项列表
106
- items: {
107
- type: Array,
108
- // []
109
- default() {
110
- return actionSheet.items
111
- }
112
- },
113
- // 选项id字段
114
- keyField: {
115
- type: String,
116
- // 'id'
117
- default: actionSheet.keyField
118
- },
119
- // 选项显示字段
120
- displayField: {
121
- type: String,
122
- // 'text'
123
- default: actionSheet.displayField
124
- },
125
- // 自定义多列联动模式的children属性名
126
- childField: {
127
- type: String,
128
- // 'children'
129
- default: actionSheet.childField
130
- },
131
- // 行高 单位默认rpx
132
- itemHeight: {
133
- type: [String, Number],
134
- // 110
135
- default: actionSheet.itemHeight
136
- },
137
- // 是否显示item下边框
138
- showItemBottomBorder: {
139
- type: Boolean,
140
- // true
141
- default: actionSheet.showItemBottomBorder
142
- },
143
- // 行样式
144
- itemStyle: {
145
- type: Object,
146
- // {}
147
- default() {
148
- return actionSheet.itemStyle
149
- }
150
- },
151
- itemAlign: {
152
- type: String,
153
- // 'center'
154
- default: actionSheet.itemAlign,
155
- validator: function(value) {
156
- return ['left', 'center', 'right'].includes(value)
157
- }
158
- },
159
- // 弹窗选择参数设置
160
- popupSelect: {
161
- type: Object,
162
- default() {
163
- // 参照popup
164
- return actionSheet.popupSelect
165
- }
166
- },
167
- // 弹窗参数设置
168
- popup: {
169
- type: Object,
170
- default() {
171
- // 参照popup
172
- return actionSheet.popup
173
- }
174
- },
175
- // 选项上方的描述信息,不填则不显示
176
- description: {
177
- type: String,
178
- // ''
179
- default: actionSheet.description
180
- },
181
- // 取消按钮文字,不填则不显示
182
- cancelText: {
183
- type: String,
184
- // ''
185
- default: actionSheet.cancelText
186
- }
187
- },
188
- data() {
189
- return {}
190
- },
191
- computed: {
192
- getPopupSelect() {
193
- return this.$pi.lang.mergeDeep(actionSheet.popupSelect, this.popupSelect)
194
- },
195
- getPopup() {
196
- const actionSheetPopup = this.$pi.lang.mergeDeep(actionSheet.popup, this.popupSelect.popup)
197
- return this.$pi.lang.mergeDeep(actionSheetPopup, this.popup)
198
- },
199
- getItemAlignStyle() {
200
- return {
201
- justifyContent: alignFlexMap[this.itemAlign]
202
- }
203
- },
204
- getItemStyle() {
205
- const itemHeight = this.$pi.common.addUnit(this.itemHeight)
206
- return {
207
- height: itemHeight,
208
- lineHeight: itemHeight
209
- }
210
- },
211
- indicatorStyle() {
212
- const itemHeight = uni.upx2px(this.itemHeight)
213
- return `height: ${itemHeight}px;line-height: ${itemHeight}px;`
214
- }
215
- },
216
- methods: {
217
- handlePopupClose() {
218
- this.val = false
219
- // 弹窗关闭
220
- this.$emit('close')
221
- this.handleEmitChange()
222
- },
223
- /**
224
- * @vuese
225
- * 取消选择
226
- */
227
- handleCancel() {
228
- this.$emit('cancel')
229
- this.getPopupSelect.onConfirmClose && this.handlePopupClose()
230
- },
231
- /**
232
- * @vuese
233
- * 确认选择
234
- */
235
- handleSelectItem(item) {
236
- if (item.disabled) return
237
- this.$emit('select', item)
238
- this.getPopupSelect.onConfirmClose && this.handlePopupClose()
239
- }
240
- }
241
- }
242
- </script>
243
-
244
- <style lang="scss" scoped>
245
- .pi-action-sheet {
246
- }
247
- </style>
1
+ <template>
2
+ <pi-popup-select
3
+ :value="val"
4
+ :custom-style="getPopupSelect.customStyle"
5
+ :custom-class="getPopupSelect.customClass"
6
+ :height="getPopupSelect.height"
7
+ :show-title="getPopupSelect.showTitle"
8
+ :title="getPopupSelect.title"
9
+ :title-padding="getPopupSelect.titlePadding"
10
+ :toolbar-position="getPopupSelect.toolbarPosition"
11
+ :on-confirm-close="getPopupSelect.onConfirmClose"
12
+ :on-cancel-close="getPopupSelect.onCancelClose"
13
+ :confirm-btn="getPopupSelect.confirmBtn"
14
+ :cancel-btn="getPopupSelect.cancelBtn"
15
+ :popup="getPopup"
16
+ @close="handlePopupClose"
17
+ @cancel="handleCancel"
18
+ @confirm="handleConfirm"
19
+ >
20
+ <slot name="header" />
21
+ <!-- 描述列 -->
22
+ <view
23
+ v-if="description"
24
+ class="pi-solid-bottom-2 pi-align-center pi-pd-32 pi-light-gray"
25
+ :style="[getItemAlignStyle]"
26
+ >
27
+ {{ description }}
28
+ </view>
29
+ <view
30
+ v-for="item in items"
31
+ :id="`id-${item[keyField]}`"
32
+ :key="item[keyField]"
33
+ :style="[
34
+ itemStyle,
35
+ getItemStyle,
36
+ getItemAlignStyle,
37
+ { color: item.color }
38
+ ]"
39
+ :class="{
40
+ 'pi-solid-bottom-1': showItemBottomBorder,
41
+ 'pi-disabled': item.disabled
42
+ }"
43
+ class="pi-align-center pi-fz-32 pi-pd-lr-32"
44
+ hover-class="pi-hover-class"
45
+ @tap.stop="handleSelectItem(item)"
46
+ >
47
+ <!-- 自定义列表项 -->
48
+ <slot name="item" :item="item" class="pi-w-100P">
49
+ <template v-if="!item.loading">
50
+ {{ item[displayField] }}
51
+ </template>
52
+ <pi-loading v-else show />
53
+ </slot>
54
+ </view>
55
+ <!-- 取消action -->
56
+ <template v-if="cancelText">
57
+ <pi-gap height="20" />
58
+ <view
59
+ class="pi-align-center pi-fz-32 pi-pd-32 pi-light-gray"
60
+ hover-class="pi-hover-class"
61
+ :style="[getItemAlignStyle]"
62
+ @tap="handleCancel"
63
+ >
64
+ {{ cancelText }}
65
+ </view>
66
+ </template>
67
+
68
+ <slot name="footer" />
69
+ </pi-popup-select>
70
+ </template>
71
+
72
+ <script>
73
+ import ValueSync from '../../mixin/value-sync'
74
+ import { getConfig } from '../../config'
75
+
76
+ const TAG = 'PiActionSheet'
77
+ const { actionSheet } = getConfig()
78
+
79
+ const alignFlexMap = {
80
+ left: 'flex-start',
81
+ center: 'center',
82
+ right: 'flex-end'
83
+ }
84
+
85
+ export default {
86
+ name: 'PiActionSheet',
87
+ // 混入v-model
88
+ mixins: [ValueSync],
89
+ props: {
90
+ // 初始值
91
+ value: {
92
+ required: false
93
+ },
94
+ // 自定义样式
95
+ customStyle: {
96
+ type: Object,
97
+ // {}
98
+ default() {
99
+ return actionSheet.customStyle
100
+ }
101
+ },
102
+ // 自定义样式类
103
+ customClass: {
104
+ type: String,
105
+ // ''
106
+ default() {
107
+ return actionSheet.customClass
108
+ }
109
+ },
110
+ // 选项列表
111
+ items: {
112
+ type: Array,
113
+ // []
114
+ default() {
115
+ return actionSheet.items
116
+ }
117
+ },
118
+ // 选项id字段
119
+ keyField: {
120
+ type: String,
121
+ // 'id'
122
+ default: actionSheet.keyField
123
+ },
124
+ // 选项显示字段
125
+ displayField: {
126
+ type: String,
127
+ // 'text'
128
+ default: actionSheet.displayField
129
+ },
130
+ // 自定义多列联动模式的children属性名
131
+ childField: {
132
+ type: String,
133
+ // 'children'
134
+ default: actionSheet.childField
135
+ },
136
+ // 行高 单位默认rpx
137
+ itemHeight: {
138
+ type: [String, Number],
139
+ // 110
140
+ default: actionSheet.itemHeight
141
+ },
142
+ // 是否显示item下边框
143
+ showItemBottomBorder: {
144
+ type: Boolean,
145
+ // true
146
+ default: actionSheet.showItemBottomBorder
147
+ },
148
+ // 行样式
149
+ itemStyle: {
150
+ type: Object,
151
+ // {}
152
+ default() {
153
+ return actionSheet.itemStyle
154
+ }
155
+ },
156
+ itemAlign: {
157
+ type: String,
158
+ // 'center'
159
+ default: actionSheet.itemAlign,
160
+ validator: function(value) {
161
+ return ['left', 'center', 'right'].includes(value)
162
+ }
163
+ },
164
+ // 弹窗选择参数设置
165
+ popupSelect: {
166
+ type: Object,
167
+ default() {
168
+ // 参照popup
169
+ return actionSheet.popupSelect
170
+ }
171
+ },
172
+ // 弹窗参数设置
173
+ popup: {
174
+ type: Object,
175
+ default() {
176
+ // 参照popup
177
+ return actionSheet.popup
178
+ }
179
+ },
180
+ // 选项上方的描述信息,不填则不显示
181
+ description: {
182
+ type: String,
183
+ // ''
184
+ default: actionSheet.description
185
+ },
186
+ // 取消按钮文字,不填则不显示
187
+ cancelText: {
188
+ type: String,
189
+ // ''
190
+ default: actionSheet.cancelText
191
+ }
192
+ },
193
+ data() {
194
+ return {}
195
+ },
196
+ computed: {
197
+ getPopupSelect() {
198
+ return this.$pi.lang.mergeDeep(actionSheet.popupSelect, this.popupSelect)
199
+ },
200
+ getPopup() {
201
+ const actionSheetPopup = this.$pi.lang.mergeDeep(
202
+ actionSheet.popup,
203
+ this.popupSelect.popup
204
+ )
205
+ return this.$pi.lang.mergeDeep(actionSheetPopup, this.popup)
206
+ },
207
+ getItemAlignStyle() {
208
+ return {
209
+ justifyContent: alignFlexMap[this.itemAlign]
210
+ }
211
+ },
212
+ getItemStyle() {
213
+ const itemHeight = this.$pi.common.addUnit(this.itemHeight)
214
+ return {
215
+ height: itemHeight,
216
+ lineHeight: itemHeight
217
+ }
218
+ },
219
+ indicatorStyle() {
220
+ const itemHeight = uni.upx2px(this.itemHeight)
221
+ return `height: ${itemHeight}px;line-height: ${itemHeight}px;`
222
+ }
223
+ },
224
+ methods: {
225
+ handlePopupClose() {
226
+ this.val = false
227
+ // 弹窗关闭
228
+ this.$emit('close')
229
+ this.handleEmitChange()
230
+ },
231
+ /**
232
+ * @vuese
233
+ * 取消选择
234
+ */
235
+ handleCancel() {
236
+ this.$emit('cancel')
237
+ this.getPopupSelect.onCancelClose && this.handlePopupClose()
238
+ },
239
+ /**
240
+ * @vuese
241
+ * 确认选择
242
+ */
243
+ handleConfirm() {
244
+ this.$emit('confirm')
245
+ this.getPopupSelect.onConfirmClose && this.handlePopupClose()
246
+ },
247
+ /**
248
+ * @vuese
249
+ * 确认选择
250
+ */
251
+ handleSelectItem(item) {
252
+ if (item.disabled) return
253
+ this.$emit('select', item)
254
+ this.getPopupSelect.onConfirmClose && this.handlePopupClose()
255
+ }
256
+ }
257
+ }
258
+ </script>
259
+
260
+ <style lang="scss" scoped></style>
@@ -1,8 +1,20 @@
1
1
  <template>
2
- <view class="badge-wrap" :style="[customStyle]" :class="[customClass]" @tap="handleClick">
2
+ <view
3
+ class="badge-wrap"
4
+ :style="[customStyle]"
5
+ :class="[customClass]"
6
+ @tap="handleClick"
7
+ >
3
8
  <view
4
9
  class="badge"
5
- :class="[{ dot, abso: $slots.default || $slots.$default }]"
10
+ :class="[
11
+ {
12
+ dot,
13
+ 'abso': $slots.default || $slots.$default,
14
+ 'hide-border':
15
+ !dot && !getContent && !($slots.content || $slots.$content)
16
+ }
17
+ ]"
6
18
  :style="[badgeStyle]"
7
19
  >
8
20
  <slot name="content">
@@ -119,6 +131,10 @@ export default {
119
131
  border: 1px solid #ffffff;
120
132
  border-radius: 16px;
121
133
 
134
+ &.hide-border {
135
+ border: none;
136
+ }
137
+
122
138
  &.dot {
123
139
  min-width: 0;
124
140
  background-color: #ee0a24;
@@ -13,12 +13,19 @@
13
13
  >
14
14
  <slot />
15
15
  </view>
16
- <view v-if="safeArea" class="pi-safearea" :style="[{ backgroundColor: safeAreaBgColor }]" />
16
+ <view
17
+ v-if="safeArea"
18
+ class="pi-safearea"
19
+ :style="[{ backgroundColor: safeAreaBgColor }]"
20
+ />
17
21
  </view>
18
22
  <!-- fixed时候的占位空间 -->
19
23
  <template v-if="fixed">
20
- <view class="pi-bottom-bar-placeholder" :style="[{ height: barHeight }]" />
21
- <view v-if="safeArea" class="pi-safearea" />
24
+ <view
25
+ class="pi-bottom-bar-placeholder"
26
+ :style="[{ height: barHeight }]"
27
+ />
28
+ <!-- <view v-if="safeArea" class="pi-safearea" /> -->
22
29
  </template>
23
30
  </view>
24
31
  </template>
@@ -114,7 +121,11 @@ export default {
114
121
  methods: {
115
122
  async init() {
116
123
  if (!this.fixed || this.height) return // fixed并且未设定height,才需要计算高度
117
- const barRect = await this.$pi.common.queryRect(this, '.pi-bottom-bar', false)
124
+ const barRect = await this.$pi.common.queryRect(
125
+ this,
126
+ '.pi-bottom-bar',
127
+ false
128
+ )
118
129
  this.barHeight = `${barRect.height}px`
119
130
  }
120
131
  }
@@ -16,7 +16,11 @@
16
16
  <view class="pi-bubble-angle pi-abso" />
17
17
  </view>
18
18
  </view>
19
- <pi-mask v-model="showMaks" background="transparent" @close="showBubble = false" />
19
+ <pi-mask
20
+ v-model="showMaks"
21
+ background="transparent"
22
+ @close="showBubble = false"
23
+ />
20
24
  </view>
21
25
  </template>
22
26
 
@@ -109,7 +113,11 @@ export default {
109
113
  this.$set(this, 'bublePosition', { top: '-9999vh', left: 0 })
110
114
  this.showBubble = true
111
115
  setTimeout(() => {
112
- reslove(this.$refs.bubble ? this.$refs.bubble.$el.getBoundingClientRect().width : 0)
116
+ reslove(
117
+ this.$refs.bubble
118
+ ? this.$refs.bubble.$el.getBoundingClientRect().width
119
+ : 0
120
+ )
113
121
  this.showBubble = false
114
122
  }, 500)
115
123
  })
@@ -120,7 +128,10 @@ export default {
120
128
  const lengthGap = (this.bubleWidth - bublePosition.width) / 2
121
129
  const compRight = this.screenWidth - bublePosition.x - bublePosition.width
122
130
  const posRes = {}
123
- if (lengthGap <= 0 || (lengthGap < bublePosition.x && lengthGap < compRight)) {
131
+ if (
132
+ lengthGap <= 0 ||
133
+ (lengthGap < bublePosition.x && lengthGap < compRight)
134
+ ) {
124
135
  posRes.left = -Math.abs(lengthGap) + 'px'
125
136
  } else {
126
137
  posRes.right = 4 - Math.min(bublePosition.x, compRight) + 'px'
@@ -31,7 +31,11 @@
31
31
  <!-- 按钮内容 -->
32
32
  <slot />
33
33
  <view v-if="ripple" class="pi-abso-full pi-of-hidden" :class="[{ round }]">
34
- <view class="wave-ripple" :class="[{ active: waveInfo.active }]" :style="[waveStyle]" />
34
+ <view
35
+ class="wave-ripple"
36
+ :class="[{ active: waveInfo.active }]"
37
+ :style="[waveStyle]"
38
+ />
35
39
  </view>
36
40
  </button>
37
41
  </template>
@@ -57,7 +61,9 @@ export default {
57
61
  // 'default'
58
62
  default: button.size,
59
63
  validator: function(value) {
60
- return ['default', 'large', 'medium', 'small', 'tiny', 'mini'].includes(value)
64
+ return ['default', 'large', 'medium', 'small', 'tiny', 'mini'].includes(
65
+ value
66
+ )
61
67
  }
62
68
  },
63
69
  // 按钮的预置样式
@@ -67,7 +73,14 @@ export default {
67
73
  // 'default'
68
74
  default: button.type,
69
75
  validator: function(value) {
70
- return ['default', 'primary', 'warn', 'secondary', 'line', 'text'].includes(value)
76
+ return [
77
+ 'default',
78
+ 'primary',
79
+ 'warn',
80
+ 'secondary',
81
+ 'line',
82
+ 'text'
83
+ ].includes(value)
71
84
  }
72
85
  },
73
86
  // 按钮是否镂空