fusions-ui 1.2.4 → 1.2.7

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 (176) hide show
  1. package/components/fu-avatar/fu-avatar.vue +4 -2
  2. package/components/fu-avatar/props.js +52 -15
  3. package/components/fu-avatar-group/fu-avatar-group.vue +3 -2
  4. package/components/fu-avatar-group/props.js +31 -9
  5. package/components/fu-badge/fu-badge.vue +8 -14
  6. package/components/fu-badge/props.js +56 -16
  7. package/components/fu-banner-arc/fu-banner-arc.vue +4 -5
  8. package/components/fu-banner-arc/props.js +15 -4
  9. package/components/fu-button/fu-button.vue +18 -20
  10. package/components/fu-button/props.js +108 -35
  11. package/components/fu-cell/fu-cell.vue +9 -8
  12. package/components/fu-cell-group/fu-cell-group.vue +2 -1
  13. package/components/fu-cell-group/props.js +7 -2
  14. package/components/fu-checkbox/fu-checkbox.vue +5 -4
  15. package/components/fu-checkbox/props.js +51 -14
  16. package/components/fu-code-input/fu-code-input.vue +10 -6
  17. package/components/fu-code-input/props.js +66 -17
  18. package/components/fu-code-verify/fu-code-verify.vue +9 -5
  19. package/components/fu-code-verify/props.js +64 -17
  20. package/components/fu-collapse/fu-collapse.vue +10 -3
  21. package/components/fu-collapse/props.js +9 -3
  22. package/components/fu-collapse-item/fu-collapse-item.vue +45 -31
  23. package/components/fu-collapse-item/props.js +49 -16
  24. package/components/fu-countdown/fu-countdown.vue +2 -1
  25. package/components/fu-countdown/props.js +15 -4
  26. package/components/fu-datetime-picker/fu-datetime-picker.vue +6 -5
  27. package/components/fu-datetime-picker/props.js +91 -25
  28. package/components/fu-form/fu-form.vue +2 -1
  29. package/components/fu-form/props.js +34 -6
  30. package/components/fu-form-item/fu-form-item.vue +26 -33
  31. package/components/fu-form-item/props.js +30 -8
  32. package/components/fu-grid/fu-grid.vue +16 -17
  33. package/components/fu-grid/props.js +20 -5
  34. package/components/fu-grid-item/fu-grid-item.vue +31 -35
  35. package/components/fu-grid-item/props.js +11 -3
  36. package/components/fu-icon/fu-icon.vue +110 -0
  37. package/components/fu-icon/fuicon.css +584 -0
  38. package/components/{fu-icons/icons.js → fu-icon/fuicon.js} +1031 -1031
  39. package/components/{fu-icons/fuicons.ttf → fu-icon/fuicon.ttf} +0 -0
  40. package/components/fu-icon/props.js +55 -0
  41. package/components/fu-image/fu-image.vue +15 -10
  42. package/components/fu-image/props.js +69 -18
  43. package/components/fu-index-anchor/fu-index-anchor.vue +6 -5
  44. package/components/fu-index-anchor/props.js +20 -6
  45. package/components/fu-index-item/fu-index-item.vue +4 -4
  46. package/components/fu-index-list/fu-index-list.vue +9 -9
  47. package/components/fu-index-list/props.js +19 -6
  48. package/components/fu-input/fu-input.vue +54 -68
  49. package/components/fu-input/props.js +145 -53
  50. package/components/fu-keyboard/fu-keyboard.vue +19 -9
  51. package/components/fu-keyboard/keyboard-car.vue +33 -22
  52. package/components/fu-keyboard/keyboard-number.vue +17 -9
  53. package/components/fu-keyboard/props.js +66 -17
  54. package/components/fu-line/fu-line.vue +17 -13
  55. package/components/fu-line/props.js +30 -5
  56. package/components/fu-link/fu-link.vue +14 -8
  57. package/components/fu-link/props.js +22 -7
  58. package/components/fu-loading/fu-loading.vue +32 -27
  59. package/components/fu-loading/props.js +28 -8
  60. package/components/fu-loading-more/fu-loading-more.vue +19 -23
  61. package/components/fu-loading-more/props.js +27 -13
  62. package/components/fu-modal/fu-modal.vue +11 -6
  63. package/components/fu-modal/props.js +61 -17
  64. package/components/{fu-nav-bar/fu-nav-bar.vue → fu-navbar/fu-navbar.vue} +37 -44
  65. package/components/fu-notice-bar/fu-notice-bar.vue +10 -8
  66. package/components/fu-notice-bar/notice-column.vue +187 -122
  67. package/components/fu-notice-bar/notice-row.vue +85 -28
  68. package/components/fu-notice-bar/props.js +83 -22
  69. package/components/fu-number-box/fu-number-box.vue +26 -28
  70. package/components/fu-number-box/props.js +37 -11
  71. package/components/fu-parse/fu-parse.vue +0 -1
  72. package/components/fu-picker/fu-picker.vue +22 -17
  73. package/components/fu-picker/props.js +70 -19
  74. package/components/fu-popup/fu-popup.vue +38 -43
  75. package/components/fu-popup/props.js +34 -9
  76. package/components/fu-progress/fu-progress.vue +3 -2
  77. package/components/fu-progress/props.js +36 -9
  78. package/components/fu-rate/fu-rate.vue +40 -32
  79. package/components/fu-rate/props.js +47 -13
  80. package/components/fu-read-more/fu-read-more.vue +19 -14
  81. package/components/fu-read-more/props.js +68 -46
  82. package/components/fu-ribbon/fu-ribbon.vue +8 -7
  83. package/components/fu-ribbon/props.js +15 -4
  84. package/components/fu-scroll-list/fu-scroll-list.vue +18 -34
  85. package/components/fu-scroll-list/props.js +19 -10
  86. package/components/fu-search/fu-search.vue +13 -18
  87. package/components/fu-search/props.js +69 -17
  88. package/components/fu-section/fu-section.vue +19 -22
  89. package/components/fu-section/props.js +30 -4
  90. package/components/fu-sign-board/fu-sign-board.vue +34 -17
  91. package/components/fu-sign-board/props.js +15 -5
  92. package/components/fu-skeleton/fu-skeleton.vue +8 -12
  93. package/components/fu-skeleton/props.js +15 -4
  94. package/components/fu-steps/fu-steps.vue +3 -2
  95. package/components/fu-steps/props.js +23 -7
  96. package/components/fu-steps-item/fu-steps-item.vue +3 -3
  97. package/components/fu-steps-item/props.js +15 -5
  98. package/components/fu-sticky/fu-sticky.vue +3 -3
  99. package/components/fu-sticky/props.js +21 -7
  100. package/components/fu-subsection/fu-subsection.vue +29 -22
  101. package/components/fu-subsection/props.js +40 -10
  102. package/components/fu-swipe-action-item/bindingx.js +1 -1
  103. package/components/fu-swipe-action-item/fu-swipe-action-item.vue +134 -123
  104. package/components/fu-swipe-action-item/mpwxs.js +1 -1
  105. package/components/fu-swipe-action-item/props.js +22 -6
  106. package/components/fu-swiper/fu-swiper.vue +29 -27
  107. package/components/fu-swiper/props.js +81 -25
  108. package/components/fu-switch/fu-switch.vue +20 -12
  109. package/components/fu-switch/props.js +48 -13
  110. package/components/fu-tabs/fu-tabs.vue +36 -33
  111. package/components/fu-tabs/props.js +46 -13
  112. package/components/fu-tag/fu-tag.vue +24 -21
  113. package/components/fu-tag/props.js +63 -17
  114. package/components/fu-text/fu-text.vue +72 -33
  115. package/components/fu-text/props.js +85 -27
  116. package/components/fu-text/value.js +6 -6
  117. package/components/fu-textarea/fu-textarea.vue +13 -17
  118. package/components/fu-textarea/props.js +103 -30
  119. package/components/fu-timeaxis/fu-timeaxis.vue +1 -1
  120. package/components/fu-timeaxis-item/fu-timeaxis-item.vue +8 -4
  121. package/components/fu-transition/fu-transition.vue +48 -49
  122. package/components/fu-transition/props.js +21 -0
  123. package/components/fu-upload/fu-upload.vue +3 -1
  124. package/components/fu-upload/props.js +67 -19
  125. package/components/fu-upload/upload-file.vue +31 -18
  126. package/components/fu-upload/upload-image.vue +37 -19
  127. package/components/fu-vtabs/fu-vtabs.vue +6 -4
  128. package/components/fu-vtabs/props.js +50 -15
  129. package/components/fu-waterfall/fu-waterfall.vue +11 -9
  130. package/components/fu-waterfall/props.js +37 -15
  131. package/index.js +17 -24
  132. package/index.scss +9 -7
  133. package/libs/config/config.js +16 -9
  134. package/libs/function/applyEven.js +9 -9
  135. package/libs/function/check.js +81 -89
  136. package/libs/function/{index.js → common.js} +5 -5
  137. package/libs/function/message.js +0 -27
  138. package/libs/mixin/mixin.js +26 -21
  139. package/libs/{utils/min.router.config.js → route/min.route.config.js} +7 -7
  140. package/libs/{utils/router.config.js → route/route.config.js} +10 -11
  141. package/libs/{css/main.scss → style/common.scss} +50 -87
  142. package/libs/style/style.h5.scss +8 -0
  143. package/libs/style/style.mp.scss +15 -0
  144. package/package.json +1 -1
  145. package/components/fu-calendar/calendar-item.vue +0 -214
  146. package/components/fu-calendar/calendar.js +0 -546
  147. package/components/fu-calendar/fu-calendar.vue +0 -536
  148. package/components/fu-calendar/i18n/en.json +0 -12
  149. package/components/fu-calendar/i18n/index.js +0 -8
  150. package/components/fu-calendar/i18n/zh-Hans.json +0 -12
  151. package/components/fu-calendar/i18n/zh-Hant.json +0 -12
  152. package/components/fu-calendar/util.js +0 -360
  153. package/components/fu-date-picker/calendar-item.vue +0 -177
  154. package/components/fu-date-picker/calendar.vue +0 -917
  155. package/components/fu-date-picker/fu-date-picker.vue +0 -1069
  156. package/components/fu-date-picker/i18n/en.json +0 -22
  157. package/components/fu-date-picker/i18n/index.js +0 -8
  158. package/components/fu-date-picker/i18n/zh-Hans.json +0 -22
  159. package/components/fu-date-picker/i18n/zh-Hant.json +0 -22
  160. package/components/fu-date-picker/props.js +0 -68
  161. package/components/fu-date-picker/time-picker.vue +0 -924
  162. package/components/fu-date-picker/util.js +0 -419
  163. package/components/fu-icons/fu-icons.vue +0 -102
  164. package/components/fu-icons/fuicons.css +0 -585
  165. package/components/fu-landscape/fu-landscape.vue +0 -167
  166. package/components/fu-landscape/props.js +0 -64
  167. package/components/fu-tabbar/fu-tabbar.vue +0 -333
  168. package/components/fu-tabbar/props.js +0 -78
  169. package/libs/css/style.h5.scss +0 -35
  170. package/libs/css/style.mp.scss +0 -50
  171. package/libs/utils/util.js +0 -58
  172. /package/components/{fu-nav-bar → fu-navbar}/props.js +0 -0
  173. /package/components/{fu-nav-bar → fu-navbar}/status-bar.vue +0 -0
  174. /package/{components/fu-datetime-picker → libs/function}/dayjs.js +0 -0
  175. /package/libs/{css → style}/color.scss +0 -0
  176. /package/libs/{css/component.scss → style/components.scss} +0 -0
@@ -3,7 +3,7 @@
3
3
  <view class="fu-row-notice__box">
4
4
  <!-- 左图标 -->
5
5
  <view class="fu-row-notice__icon--left" v-if="leftIcon">
6
- <fu-icons :name="leftIconName" :size="leftIconSize" :color="leftIconColor"></fu-icons>
6
+ <fu-icon :name="leftIconName" :size="leftIconSize" :color="leftIconColor"></fu-icon>
7
7
  </view>
8
8
 
9
9
  <!-- 消息体 -->
@@ -20,7 +20,7 @@
20
20
 
21
21
  <!-- 右图标 -->
22
22
  <view class="fu-row-notice__icon--right" @click="handleClickRight" v-if="rightIcon">
23
- <fu-icons :name="rightIconName" :size="rightIconSize" :color="rightIconColor"></fu-icons>
23
+ <fu-icon :name="rightIconName" :size="rightIconSize" :color="rightIconColor"></fu-icon>
24
24
  </view>
25
25
  </view>
26
26
  </view>
@@ -47,95 +47,149 @@
47
47
  * @property {String} fontColor 字体颜色
48
48
  * @property {String,Number} fontSize 字体大小(默认 14)
49
49
  * @property {String} bgColor 背景颜色
50
+ *
51
+ * @event {Function} click 点击通知栏文字触发
52
+ * @event {Function} clickRight 点击右侧图标触发
53
+ * @example <notice-row :list="list"></notice-row>
50
54
  */
51
55
  export default {
52
56
  name: "NoticeRow",
53
57
  mixins: [mpMixin, mixin],
54
58
  emits: ['click', 'clickRight'],
55
59
  props: {
56
- // 显示的内容
60
+ /**
61
+ * @description 显示的内容
62
+ */
57
63
  list: {
58
64
  type: Array,
59
65
  default () {
60
66
  return []
61
67
  }
62
68
  },
63
- // 是否显示 默认 true
69
+ /**
70
+ * @description 是否显示
71
+ * @default true
72
+ */
64
73
  show: {
65
74
  type: Boolean,
66
75
  default: true
67
76
  },
68
- // 是否显示左边图标
77
+ /**
78
+ * @description 是否显示左边图标
79
+ * @default true
80
+ */
69
81
  leftIcon: {
70
82
  type: Boolean,
71
83
  default: true
72
84
  },
73
- // 左边图标的名称
85
+ /**
86
+ * @description 左边图标的名称
87
+ * @default 'volume'
88
+ */
74
89
  leftIconName: {
75
90
  type: String,
76
91
  default: 'volume'
77
92
  },
78
- // 左边图标的大小
93
+ /**
94
+ * @description 左边图标的大小
95
+ * @default 20
96
+ */
79
97
  leftIconSize: {
80
98
  type: [String, Number],
81
99
  default: 20
82
100
  },
83
- // 左边图标的颜色
101
+ /**
102
+ * @description 左边图标的颜色
103
+ * @default '#333333'
104
+ */
84
105
  leftIconColor: {
85
106
  type: String,
86
107
  default: '#333333'
87
108
  },
88
- // 是否显示右边的图标
109
+ /**
110
+ * @description 是否显示右边的图标
111
+ * @default false
112
+ */
89
113
  rightIcon: {
90
114
  type: Boolean,
91
115
  default: false
92
116
  },
93
- // 右边图标的名称
117
+ /**
118
+ * @description 右边图标的名称
119
+ * @default 'right'
120
+ */
94
121
  rightIconName: {
95
122
  type: String,
96
123
  default: 'right'
97
124
  },
98
- // 右边图标的大小
125
+ /**
126
+ * @description 右边图标的大小
127
+ * @default 20
128
+ */
99
129
  rightIconSize: {
100
130
  type: [String, Number],
101
- default: 26
131
+ default: 20
102
132
  },
103
- // 右边图标的颜色
133
+ /**
134
+ * @description 右边图标的颜色
135
+ * @default '#333333'
136
+ */
104
137
  rightIconColor: {
105
138
  type: String,
106
139
  default: '#333333'
107
140
  },
108
- // 是否显示关闭按钮
141
+ /**
142
+ * @description 是否显示关闭按钮
143
+ * @default false
144
+ */
109
145
  showClose: {
110
146
  type: Boolean,
111
147
  default: false
112
148
  },
113
- // 内边距
149
+ /**
150
+ * @description 内边距
151
+ * @default '9px 12px'
152
+ */
114
153
  padding: {
115
154
  type: String,
116
155
  default: '9px 12px'
117
156
  },
118
- // 自动播放
157
+ /**
158
+ * @description 自动播放
159
+ * @default true
160
+ */
119
161
  autoPlay: {
120
162
  type: Boolean,
121
163
  default: true
122
164
  },
123
- // 水平滚动时的速度,即每秒滚动多少px
165
+ /**
166
+ * @description 水平滚动时的速度,即每秒滚动多少px
167
+ * @default 80
168
+ */
124
169
  speed: {
125
170
  type: Number,
126
171
  default: 80
127
172
  },
128
- // 背景颜色
173
+ /**
174
+ * @description 背景颜色
175
+ * @default '#f9f9f9'
176
+ */
129
177
  bgColor: {
130
178
  type: String,
131
- default: ''
179
+ default: '#f9f9f9'
132
180
  },
133
- // 字体颜色
181
+ /**
182
+ * @description 字体颜色
183
+ * @default '#333333'
184
+ */
134
185
  fontColor: {
135
186
  type: String,
136
- default: ''
187
+ default: '#333333'
137
188
  },
138
- // 字体大小
189
+ /**
190
+ * @description 字体大小
191
+ * @default 14
192
+ */
139
193
  fontSize: {
140
194
  type: [String, Number],
141
195
  default: 14
@@ -250,13 +304,16 @@
250
304
  </script>
251
305
 
252
306
  <style lang="scss" scoped>
307
+ @import '../../libs/style/components.scss';
308
+
253
309
  .fu-row-notice {
254
310
  flex: 1;
311
+ /* #ifndef APP-NVUE */
255
312
  overflow: hidden;
313
+ /* #endif */
256
314
 
257
315
  &__box {
258
- display: flex;
259
- flex-direction: row;
316
+ @include flex(row);
260
317
  align-items: center;
261
318
  justify-content: space-between;
262
319
  }
@@ -265,13 +322,13 @@
265
322
 
266
323
  &--box {
267
324
  flex: 1;
268
- display: flex;
269
- flex-direction: row;
325
+ @include flex(row);
326
+ /* #ifndef APP-NVUE */
270
327
  overflow: hidden;
328
+ /* #endif */
271
329
  }
272
330
 
273
- display: flex;
274
- flex-direction: row;
331
+ @include flex(row);
275
332
  flex-wrap: nowrap;
276
333
  text-align: right;
277
334
  padding-left: 100%;
@@ -1,109 +1,170 @@
1
1
  export default {
2
2
  props: {
3
- // 显示的内容
3
+ /**
4
+ * @description 显示的内容
5
+ */
4
6
  list: {
5
7
  type: Array,
6
8
  default() {
7
9
  return []
8
10
  }
9
11
  },
10
- // 是否显示 默认 false
12
+ /**
13
+ * @description 是否显示
14
+ * @default true
15
+ */
11
16
  show: {
12
17
  type: Boolean,
13
18
  default: true
14
19
  },
15
- // 定义圆角 默认 0
20
+ /**
21
+ * @description 设置圆角
22
+ */
16
23
  radius: {
17
24
  type: [Number,String],
18
25
  default: 0
19
26
  },
20
- // 滚动方向
21
- // row -> 水平滚动 column -> 垂直滚动
27
+ /**
28
+ * @description 滚动方向
29
+ * @values 'row' - 水平滚动, 'column' - 垂直滚动
30
+ * @default 'row'
31
+ */
22
32
  mode: {
23
33
  type: String,
24
34
  default: 'row'
25
35
  },
26
- // 是否显示左边图标
36
+ /**
37
+ * @description 是否显示左边图标
38
+ * @default true
39
+ */
27
40
  leftIcon: {
28
41
  type: Boolean,
29
42
  default: true
30
43
  },
31
- // 左边图标的名称
44
+ /**
45
+ * @description 左边图标的名称
46
+ * @default 'volume'
47
+ */
32
48
  leftIconName: {
33
49
  type: String,
34
50
  default: 'volume'
35
51
  },
36
- // 左边图标的大小
52
+ /**
53
+ * @description 左边图标的大小
54
+ * @default 20
55
+ */
37
56
  leftIconSize: {
38
57
  type: [String,Number],
39
58
  default: 20
40
59
  },
41
- // 左边图标的颜色
60
+ /**
61
+ * @description 左边图标的颜色
62
+ * @default '#333333'
63
+ */
42
64
  leftIconColor: {
43
65
  type: String,
44
66
  default: '#333333'
45
67
  },
46
- // 是否显示右边的图标
68
+ /**
69
+ * @description 是否显示右边的图标
70
+ * @default false
71
+ */
47
72
  rightIcon: {
48
73
  type: Boolean,
49
74
  default: false
50
75
  },
51
- // 右边图标的名称
76
+ /**
77
+ * @description 右边图标的名称
78
+ * @default 'right'
79
+ */
52
80
  rightIconName: {
53
81
  type: String,
54
82
  default: 'right'
55
83
  },
56
- // 右边图标的大小
84
+ /**
85
+ * @description 右边图标的大小
86
+ * @default 20
87
+ */
57
88
  rightIconSize: {
58
89
  type: [String,Number],
59
90
  default: 20
60
91
  },
61
- // 右边图标的颜色
92
+ /**
93
+ * @description 右边图标的颜色
94
+ * @default '#333333'
95
+ */
62
96
  rightIconColor: {
63
97
  type: String,
64
98
  default: '#333333'
65
99
  },
66
- // 内边距
100
+ /**
101
+ * @description 内边距
102
+ * @default '9px 12px'
103
+ */
67
104
  padding: {
68
105
  type: String,
69
106
  default: '9px 12px'
70
107
  },
71
- // 自动播放
108
+ /**
109
+ * @description 自动播放
110
+ * @default true
111
+ */
72
112
  autoPlay: {
73
113
  type: Boolean,
74
114
  default: true
75
115
  },
76
- // 滚动周期
116
+ /**
117
+ * @description 滚动周期
118
+ * @default 2000
119
+ */
77
120
  duration: {
78
121
  type: Number,
79
122
  default: 2000
80
123
  },
81
- // 水平滚动时的速度,即每秒滚动多少px
124
+ /**
125
+ * @description 水平滚动时的速度,即每秒滚动多少px
126
+ * @default 80
127
+ */
82
128
  speed: {
83
129
  type: Number,
84
130
  default: 80
85
131
  },
86
- // 水平滚动的时候是否采用衔接的模式
132
+ /**
133
+ * @description 水平滚动的时候是否采用衔接的模式
134
+ * @default true
135
+ */
87
136
  circular: {
88
137
  type: Boolean,
89
138
  default: true
90
139
  },
91
- // 没有数据时是否显示通知
140
+ /**
141
+ * @description 没有数据时是否显示通知
142
+ * @default true
143
+ */
92
144
  autoHidden: {
93
145
  type: Boolean,
94
146
  default: true
95
147
  },
96
- // 背景颜色
148
+ /**
149
+ * @description 背景颜色
150
+ * @default '#f9f9f9'
151
+ */
97
152
  bgColor: {
98
153
  type: String,
99
154
  default: '#f9f9f9'
100
155
  },
101
- // 字体颜色
156
+ /**
157
+ * @description 字体颜色
158
+ * @default '#333333'
159
+ */
102
160
  color: {
103
161
  type: String,
104
162
  default: '#333333'
105
163
  },
106
- // 字体大小
164
+ /**
165
+ * @description 字体大小
166
+ * @default 14
167
+ */
107
168
  size: {
108
169
  type: [String,Number],
109
170
  default: 14
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view class="fu-numbox">
3
- <view @click="_calcValue('minus')" class="fu-numbox__minus fu-numbox-btns" :style="{background: bgColor}">
3
+ <view @click="handleCalcValue('minus')" class="fu-numbox__minus fu-numbox-btns" :style="{background: bgColor}">
4
4
  <slot name="minus">
5
5
  <text class="fu-numbox--text" :class="{ 'fu-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text>
6
6
  </slot>
@@ -11,11 +11,11 @@
11
11
  class="fu-numbox__value"
12
12
  :style="[inputStyle]"
13
13
  :disabled="inputDisabled"
14
- @focus="_onFocus"
15
- @blur="_onBlur"
14
+ @focus="handleFocus"
15
+ @blur="handleBlur"
16
16
  type="number" />
17
17
  </slot>
18
- <view @click="_calcValue('plus')" class="fu-numbox__plus fu-numbox-btns" :style="{background: bgColor}">
18
+ <view @click="handleCalcValue('plus')" class="fu-numbox__plus fu-numbox-btns" :style="{background: bgColor}">
19
19
  <slot name="plus">
20
20
  <text class="fu-numbox--text" :class="{ 'fu-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text>
21
21
  </slot>
@@ -30,17 +30,19 @@
30
30
  * NumberBox 数字输入框
31
31
  * @description 此组件带加减按钮的数字输入框
32
32
  * @property {Number} value 输入框当前值
33
- * @property {Number} min 最小值
34
- * @property {Number} max 最大值
35
- * @property {Number} step 每次点击改变的间隔大小
36
- * @property {String} bgColor 背景色
33
+ * @property {Number} min 设置最小值(默认 0)
34
+ * @property {Number} max 设置最大值(默认 100)
35
+ * @property {Number} step 每次点击改变的间隔大小(默认 1)
36
+ * @property {String} bgColor 背景颜色
37
37
  * @property {String} color 字体颜色(前景色)
38
38
  * @property {Boolean} disabled = [true|false] 是否为禁用状态
39
39
  * @property {Boolean} inputDisabled = [true|false] input是否为禁用状态
40
- * @property {String,Number} size 自定义字体大小 默认14
40
+ * @property {String,Number} size 自定义字体大小(默认 14
41
+ *
41
42
  * @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value
42
43
  * @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象
43
44
  * @event {Function} blur 输入框失焦时触发的事件,参数为 event 对象
45
+ * @example <fu-number-box></fu-number-box>
44
46
  */
45
47
  export default {
46
48
  name: "FuNumberBox",
@@ -69,11 +71,11 @@
69
71
  }
70
72
  },
71
73
  methods: {
72
- _calcValue(type) {
74
+ handleCalcValue(type) {
73
75
  if (this.disabled) {
74
76
  return;
75
77
  }
76
- const scale = this._getDecimalScale();
78
+ const scale = this.handleDecimalScale();
77
79
  let value = this.inputValue * scale;
78
80
  let step = this.step * scale;
79
81
  if (type === "minus") {
@@ -98,13 +100,13 @@
98
100
 
99
101
  this.inputValue = (value / scale).toFixed(String(scale).length - 1);
100
102
  // Vue2 兼容
101
- this.$emit("input", + this.inputValue);
103
+ this.$emit("input", +this.inputValue);
102
104
  // Vue3 兼容
103
- this.$emit("update:modelValue", + this.inputValue);
104
- this.$emit("change", + this.inputValue);
105
+ this.$emit("update:modelValue", +this.inputValue);
106
+ this.$emit("change", +this.inputValue);
105
107
  },
106
- _getDecimalScale() {
107
-
108
+
109
+ handleDecimalScale() {
108
110
  let scale = 1;
109
111
  // 浮点型
110
112
  if (~~this.step !== this.step) {
@@ -112,7 +114,8 @@
112
114
  }
113
115
  return scale;
114
116
  },
115
- _onBlur(event) {
117
+
118
+ handleBlur(event) {
116
119
  this.$emit('blur', event)
117
120
  let value = event.detail.value;
118
121
  if (isNaN(value)) {
@@ -125,13 +128,14 @@
125
128
  } else if (value < this.min) {
126
129
  value = this.min;
127
130
  }
128
- const scale = this._getDecimalScale();
131
+ const scale = this.handleDecimalScale();
129
132
  this.inputValue = value.toFixed(String(scale).length - 1);
130
133
  this.$emit("input", +this.inputValue);
131
134
  this.$emit("update:modelValue", +this.inputValue);
132
135
  this.$emit("change", +this.inputValue);
133
136
  },
134
- _onFocus(event) {
137
+
138
+ handleFocus(event) {
135
139
  this.$emit('focus', event)
136
140
  }
137
141
  },
@@ -147,23 +151,18 @@
147
151
  </script>
148
152
 
149
153
  <style lang="scss" scoped>
154
+ @import '../../libs/style/components.scss';
150
155
  $box-height: 26px;
151
156
  $bg: #f5f5f5;
152
157
  $br: 2px;
153
158
  $color: #333;
154
159
 
155
160
  .fu-numbox {
156
- /* #ifndef APP-NVUE */
157
- display: flex;
158
- /* #endif */
159
- flex-direction: row;
161
+ @include flex(row);
160
162
  }
161
163
 
162
164
  .fu-numbox-btns {
163
- /* #ifndef APP-NVUE */
164
- display: flex;
165
- /* #endif */
166
- flex-direction: row;
165
+ @include flex(row);
167
166
  align-items: center;
168
167
  justify-content: center;
169
168
  padding: 0 8px;
@@ -196,7 +195,6 @@
196
195
  }
197
196
 
198
197
  .fu-numbox--text {
199
- // fix nvue
200
198
  line-height: 20px;
201
199
  font-size: 20px;
202
200
  font-weight: 300;
@@ -1,50 +1,76 @@
1
1
  export default {
2
2
  props: {
3
- // value 输入框当前值
3
+ /**
4
+ * @description value / v-model 输入框当前值
5
+ */
4
6
  value: {
5
7
  type: [Number, String],
6
- default: 1
8
+ default: 0
7
9
  },
8
10
  modelValue: {
9
11
  type: [Number, String],
10
- default: 1
12
+ default: 0
11
13
  },
12
- // 最小值
14
+ /**
15
+ * @description 设置最小值
16
+ * @default 0
17
+ */
13
18
  min: {
14
19
  type: Number,
15
20
  default: 0
16
21
  },
17
- // 最大值
22
+ /**
23
+ * @description 设置最大值
24
+ * @default 100
25
+ */
18
26
  max: {
19
27
  type: Number,
20
28
  default: 100
21
29
  },
22
- // 每次点击改变的间隔大小
30
+ /**
31
+ * @description 每次点击改变的间隔大小
32
+ * @default 1
33
+ */
23
34
  step: {
24
35
  type: Number,
25
36
  default: 1
26
37
  },
27
- // 背景色
38
+ /**
39
+ * @description 背景颜色
40
+ * @default '#f5f5f5'
41
+ */
28
42
  bgColor: {
29
43
  type: String,
30
44
  default: '#f5f5f5'
31
45
  },
32
- // 字体颜色(前景色)
46
+ /**
47
+ * @description 字体颜色(前景色)
48
+ * @default '#333333'
49
+ */
33
50
  color: {
34
51
  type: String,
35
52
  default: '#333333'
36
53
  },
37
- // 是否为禁用状态
54
+ /**
55
+ * @description 是否为禁用状态
56
+ * @default false
57
+ */
38
58
  disabled: {
39
59
  type: Boolean,
40
60
  default: false
41
61
  },
42
- // 自定义字体大小 默认14
62
+ /**
63
+ * @description 字体大小
64
+ * @default 14
65
+ */
43
66
  size: {
44
67
  type: [String,Number],
45
68
  default: 14
46
69
  },
47
- // input是否为禁用状态
70
+ /**
71
+ * @description input是否为禁用状态
72
+ * @default false
73
+ */
48
74
  inputDisabled: {
49
75
  type: Boolean,
50
76
  default: false
@@ -504,6 +504,5 @@
504
504
  ._select {
505
505
  user-select: text;
506
506
  }
507
-
508
507
  /* #endif */
509
508
  </style>