fusions-ui 1.2.4 → 1.2.6

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 +107 -0
  37. package/components/fu-icon/icon.css +584 -0
  38. package/components/{fu-icons/icons.js → fu-icon/icon.js} +1031 -1031
  39. package/components/{fu-icons/fuicons.ttf → fu-icon/icon.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 +18 -3
  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
@@ -1,65 +1,98 @@
1
1
  export default {
2
2
  props: {
3
- // 列表标题
4
- title: {
5
- type: String,
6
- default: ''
7
- },
8
- // 唯一标志符
3
+ /**
4
+ * @description 唯一标志符
5
+ */
9
6
  name: {
10
7
  type: [String,Number],
11
8
  default: ''
12
9
  },
13
- // 是否禁用
10
+ /**
11
+ * @description 列表标题
12
+ */
13
+ title: {
14
+ type: String,
15
+ default: ''
16
+ },
17
+ /**
18
+ * @description 是否禁用
19
+ * @default false
20
+ */
14
21
  disabled: {
15
22
  type: Boolean,
16
23
  default: false
17
24
  },
18
25
  // #ifdef APP-PLUS
19
- // 是否显示动画,app 端默认不开启动画,卡顿严重
26
+ /**
27
+ * @description 是否显示动画,app 端默认不开启动画,卡顿严重
28
+ * @default false
29
+ */
20
30
  showAnimation: {
21
31
  type: Boolean,
22
32
  default: false
23
33
  },
24
34
  // #endif
25
35
  // #ifndef APP-PLUS
26
- // 是否显示动画
36
+ /**
37
+ * @description 是否显示动画
38
+ * @default true
39
+ */
27
40
  showAnimation: {
28
41
  type: Boolean,
29
42
  default: true
30
43
  },
31
44
  // #endif
32
- // 是否展开
45
+ /**
46
+ * @description 是否展开
47
+ * @default false
48
+ */
33
49
  open: {
34
50
  type: Boolean,
35
51
  default: false
36
52
  },
37
- // 缩略图
53
+ /**
54
+ * @description 缩略图
55
+ */
38
56
  thumb: {
39
57
  type: String,
40
58
  default: ''
41
59
  },
42
- // 标题分隔线显示类型
60
+ /**
61
+ * @description 标题分隔线显示类型
62
+ * @default 'auto'
63
+ */
43
64
  titleBorder: {
44
65
  type: String,
45
66
  default: 'auto'
46
67
  },
47
- // 是否显示分隔线 默认true
68
+ /**
69
+ * @description 是否显示分隔线
70
+ * @default true
71
+ */
48
72
  border: {
49
73
  type: Boolean,
50
74
  default: true
51
75
  },
52
- // 是否显示右侧箭头
76
+ /**
77
+ * @description 是否显示右侧箭头
78
+ * @default true
79
+ */
53
80
  showArrow: {
54
81
  type: Boolean,
55
82
  default: true
56
83
  },
57
- // 自定义背景色
84
+ /**
85
+ * @description 背景颜色
86
+ * @default '#FFFFFF'
87
+ */
58
88
  bgColor: {
59
89
  type: String,
60
90
  default: '#FFFFFF'
61
91
  },
62
- // 自定义内间距
92
+ /**
93
+ * @description 内间距
94
+ * @default '0 30rpx'
95
+ */
63
96
  padding: {
64
97
  type: String,
65
98
  default: '0 30rpx'
@@ -17,6 +17,7 @@
17
17
  * @property {String} format 时间格式,D-日,h-时,m-分,s-秒,SSS-毫秒 (默认 'h:m:s' )
18
18
  * @property {Boolean} autoStart = [true|false] 是否自动开始倒计时 (默认 true )
19
19
  * @property {Boolean} millisecond = [true|false] 是否展示毫秒倒计时 (默认 false )
20
+ *
20
21
  * @event {Function} change 倒计时变化时触发
21
22
  * @event {Function} timeup 倒计时结束时触发
22
23
  * @event {Function} start 开始倒计时
@@ -149,7 +150,7 @@
149
150
  }
150
151
  </script>
151
152
  <style lang="scss" scoped>
152
- $fu-countdown-text-color: #717579 !default;
153
+ $fu-countdown-text-color: #333333 !default;
153
154
  $fu-countdown-text-font-size: 15px !default;
154
155
  $fu-countdown-text-line-height: 22px !default;
155
156
 
@@ -1,21 +1,32 @@
1
1
  export default {
2
2
  props: {
3
- // 倒计时时长,单位ms
3
+ /**
4
+ * @description 倒计时时长,单位ms
5
+ */
4
6
  time: {
5
7
  type: [String,Number],
6
8
  default: 0
7
9
  },
8
- // 时间格式,D-日,h-时,m-分,s-秒,SSS-毫秒(默认 'h:m:s' )
10
+ /**
11
+ * @description 时间格式,D-日,h-时,m-分,s-秒,SSS-毫秒(默认 'h:m:s')
12
+ * @default 'h:m:s'
13
+ */
9
14
  format: {
10
15
  type: String,
11
16
  default: 'h:m:s'
12
17
  },
13
- // 是否自动开始倒计时
18
+ /**
19
+ * @description 是否自动开始倒计时
20
+ * @default true
21
+ */
14
22
  autoStart: {
15
23
  type: Boolean,
16
24
  default: true
17
25
  },
18
- // 是否展示毫秒倒计时
26
+ /**
27
+ * @description 是否展示毫秒倒计时
28
+ * @default false
29
+ */
19
30
  millisecond: {
20
31
  type: Boolean,
21
32
  default: false
@@ -22,6 +22,10 @@
22
22
  </template>
23
23
 
24
24
  <script>
25
+ import mpMixin from '../../libs/mixin/mpMixin.js';
26
+ import mixin from '../../libs/mixin/mixin.js';
27
+ import dayjs from '../../libs/function/dayjs.js';
28
+ import props from './props.js';
25
29
  function times(n, iteratee) {
26
30
  let index = -1
27
31
  const result = Array(n < 0 ? 0 : n)
@@ -30,10 +34,6 @@
30
34
  }
31
35
  return result
32
36
  }
33
- import mpMixin from '../../libs/mixin/mpMixin.js';
34
- import mixin from '../../libs/mixin/mixin.js';
35
- import dayjs from './dayjs.js';
36
- import props from './props.js';
37
37
  /**
38
38
  * DatetimePicker 时间日期选择器
39
39
  * @description 此组件选择器用于时间日期
@@ -66,6 +66,7 @@
66
66
  * @property {String,Number} visibleItemCount 每列中可见选项的数量 ( 默认 5 )
67
67
  * @property {Array} defaultIndex 各列的默认索引
68
68
  * @property {Boolean} maskClosable = [true|false] 是否允许点击遮罩关闭选择器 默认 true
69
+ *
69
70
  * @event {Function} close 关闭选择器时触发
70
71
  * @event {Function} confirm 点击确定按钮,返回当前选择的值
71
72
  * @event {Function} change 当选择值变化时触发
@@ -278,7 +279,7 @@
278
279
  // 得出合法的时间
279
280
  correctValue(value) {
280
281
  const isDateMode = this.mode !== 'time';
281
- if (isDateMode && !this.$fu.date(value)) {
282
+ if (isDateMode && !this.$fu.checkDate(value)) {
282
283
  // 如果是日期类型,但是又没有设置合法的当前时间的话,使用最小时间为当前时间
283
284
  value = this.minDate;
284
285
  } else if (!isDateMode && !value) {
@@ -1,6 +1,8 @@
1
1
  export default {
2
2
  props: {
3
- // 绑定值
3
+ /**
4
+ * @description 绑定值
5
+ */
4
6
  value: {
5
7
  type: [String, Number],
6
8
  default: 0
@@ -9,117 +11,181 @@ export default {
9
11
  type: [String, Number],
10
12
  default: ''
11
13
  },
12
- // 顶部标题
14
+ /**
15
+ * @description 顶部标题
16
+ */
13
17
  title: {
14
18
  type: String,
15
19
  default: ''
16
20
  },
17
- // 顶部标题字体大小 默认15 (注:不传单位,默认px)
21
+ /**
22
+ * @description 顶部标题字体大小 (注:不传单位,默认px)
23
+ * @default 15
24
+ */
18
25
  titleSize: {
19
26
  type: [String,Number],
20
27
  default: 15
21
28
  },
22
- // 顶部标题字体颜色
29
+ /**
30
+ * @description 顶部标题字体颜色
31
+ * @default '#333333'
32
+ */
23
33
  titleColor: {
24
34
  type: String,
25
35
  default: '#333333'
26
36
  },
27
- // 展示格式 mode=date为日期选择,mode=time为时间选择,mode=year为年选择, mode=year-month为年月选择,mode=datetime为日期时间选择 ( 默认 'datetime' )
37
+ /**
38
+ * @description 展示格式
39
+ * @values 'date' - 日期选择, 'time' - 时间选择, 'year' - 年选择, 'year-month' - 年月选择, 'datetime' - 日期时间选择
40
+ * @default 'datetime'
41
+ */
28
42
  mode: {
29
43
  type: String,
30
44
  default: 'datetime'
31
45
  },
32
- // 可选的最大时间 最大默认值为后10年
46
+ /**
47
+ * @description 可选的最大时间 最大默认值为后10年
48
+ */
33
49
  maxDate: {
34
50
  type: Number,
35
51
  default: new Date(new Date().getFullYear() + 10, 0, 1).getTime()
36
52
  },
37
- // 可选的最小时间 最小默认值为前10年
53
+ /**
54
+ * @description 可选的最小时间 最小默认值为前10年
55
+ */
38
56
  minDate: {
39
57
  type: Number,
40
58
  default: new Date(new Date().getFullYear() - 10, 0, 1).getTime()
41
59
  },
42
- // 可选的最小小时,仅mode=time有效
60
+ /**
61
+ * @description 可选的最小小时(仅mode=time时生效)
62
+ */
43
63
  minHour: {
44
64
  type: Number,
45
65
  default: 0
46
66
  },
47
- // 可选的最大小时,仅mode=time有效
67
+ /**
68
+ * @description 可选的最大小时(仅mode=time时生效)
69
+ * @default 23
70
+ */
48
71
  maxHour: {
49
72
  type: Number,
50
73
  default: 23
51
74
  },
52
- // 可选的最小分钟,仅mode=time有效
75
+ /**
76
+ * @description 可选的最小分钟(仅mode=time时生效)
77
+ * @default 0
78
+ */
53
79
  minMinute: {
54
80
  type: Number,
55
81
  default: 0
56
82
  },
57
- // 可选的最大分钟,仅mode=time有效
83
+ /**
84
+ * @description 可选的最大分钟(仅mode=time时生效)
85
+ * @default 59
86
+ */
58
87
  maxMinute: {
59
88
  type: Number,
60
89
  default: 59
61
90
  },
62
- // 选项过滤函数 默认null
91
+ /**
92
+ * @description 选项过滤函数
93
+ * @default null
94
+ */
63
95
  filter: {
64
96
  type: [Function, null],
65
97
  default: null
66
98
  },
67
- // 选项格式化函数
99
+ /**
100
+ * @description 选项格式化函数
101
+ * @default null
102
+ */
68
103
  formatter: {
69
104
  type: [Function, null],
70
105
  default: null
71
106
  },
72
- // 是否显示加载中状态 默认false
107
+ /**
108
+ * @description 是否显示加载中状态
109
+ * @default false
110
+ */
73
111
  loading: {
74
112
  type: Boolean,
75
113
  default: false
76
114
  },
77
- // 各列中,单个选项的高度 ( 默认 44 )
115
+ /**
116
+ * @description 各列中,单个选项的高度
117
+ * @default 44
118
+ */
78
119
  itemHeight: {
79
120
  type: [String, Number],
80
121
  default: 44
81
122
  },
82
- // 取消按钮的文字 默认取消
123
+ /**
124
+ * @description 取消按钮的文字
125
+ * @default '取消'
126
+ */
83
127
  cancelText: {
84
128
  type: String,
85
129
  default: '取消'
86
130
  },
87
- // 取消按钮字体大小 默认13 (注:不传单位,默认px)
131
+ /**
132
+ * @description 取消按钮字体大小 (注:不传单位,默认px)
133
+ * @default 13
134
+ */
88
135
  cancelSize: {
89
136
  type: [String,Number],
90
137
  default: 13
91
138
  },
92
- // 取消按钮文本颜色
139
+ /**
140
+ * @description 取消按钮文本颜色
141
+ * @default '#888888'
142
+ */
93
143
  cancelColor: {
94
144
  type: String,
95
145
  default: '#888888'
96
146
  },
97
- // 确认按钮的文字
147
+ /**
148
+ * @description 确认按钮的文字
149
+ * @default '确认'
150
+ */
98
151
  confirmText: {
99
152
  type: String,
100
- default: '确定'
153
+ default: '确认'
101
154
  },
102
- // 确认按钮字体大小 默认13 (注:不传单位,默认px)
155
+ /**
156
+ * @description 确认按钮字体大小 (注:不传单位,默认px)
157
+ * @default 13
158
+ */
103
159
  confirmSize: {
104
160
  type: [String,Number],
105
161
  default: 13
106
162
  },
107
- // 确认按钮文本颜色
163
+ /**
164
+ * @description 确认按钮文本颜色
165
+ */
108
166
  confirmColor: {
109
167
  type: String,
110
168
  default: ''
111
169
  },
112
- // 每列中可见选项的数量
170
+ /**
171
+ * @description 每列中可见选项的数量
172
+ * @default 5
173
+ */
113
174
  visibleItemCount: {
114
175
  type: [String, Number],
115
176
  default: 5
116
177
  },
117
- // 各列的默认索引
178
+ /**
179
+ * @description 各列的默认索引
180
+ */
118
181
  defaultIndex: {
119
182
  type: Array,
120
183
  default: () => []
121
184
  },
122
- // 是否允许点击遮罩关闭选择器 默认 true
185
+ /**
186
+ * @description 是否允许点击遮罩关闭选择器
187
+ * @default true
188
+ */
123
189
  maskClosable: {
124
190
  type: Boolean,
125
191
  default: true
@@ -24,6 +24,7 @@
24
24
  /**
25
25
  * Form 表单
26
26
  * @description 此组件由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据
27
+ * @property {Object} model 表单数据
27
28
  * @property {Object} rules 表单校验规则
28
29
  * @property {String} validateTrigger = [bind|submit|blur] 校验触发器方式 默认 submit
29
30
  * @value bind 发生变化时触发
@@ -34,7 +35,7 @@
34
35
  * @value left 左侧显示 label
35
36
  * @property {String} labelWidth label 宽度,默认 70
36
37
  * @property {String} labelAlign = [left|center|right] label 居中方式 默认 left
37
- * @value left label 左侧显示
38
+ * @value left label 左侧对齐
38
39
  * @value center label 居中
39
40
  * @value right label 右侧对齐
40
41
  * @property {String} errShowType = [undertext|toast|modal] 校验错误信息提示方式
@@ -1,43 +1,71 @@
1
1
  export default {
2
2
  props: {
3
+ /**
4
+ * @description 绑定数据
5
+ * @default null
6
+ */
3
7
  model: {
4
8
  type: Object,
5
9
  default () {
6
10
  return null;
7
11
  }
8
12
  },
9
- // 表单校验规则
13
+ /**
14
+ * @description 表单校验规则
15
+ */
10
16
  rules: {
11
17
  type: Object,
12
18
  default () {
13
19
  return {};
14
20
  }
15
21
  },
16
- // 校验触发器方式 默认 submit 取值 [bind|submit|blur]
22
+ /**
23
+ * @description 校验触发器方式
24
+ * @values 'bind' - 发生变化时触发, 'submit' - 提交时触发, 'blur' - 失去焦点时触发
25
+ * @default 'submit'
26
+ */
17
27
  validateTrigger: {
18
28
  type: String,
19
29
  default: 'submit'
20
30
  },
21
- //校验错误信息提示方式 默认 undertext 取值 [undertext|toast|modal]
31
+ /**
32
+ * @description 校验错误信息提示方式
33
+ * @values 'undertext' - 错误信息在底部显示, 'toast' - 错误信息toast显示, 'modal' - 错误信息modal显示
34
+ * @default 'undertext'
35
+ */
22
36
  errShowType: {
23
37
  type: String,
24
38
  default: 'undertext'
25
39
  },
26
- // label 位置,默认 left 取值 top/left
40
+ /**
41
+ * @description label 位置
42
+ * @values 'top' - 顶部显示 label, 'left' - 左侧显示 label
43
+ * @default 'left'
44
+ */
27
45
  labelPosition: {
28
46
  type: String,
29
47
  default: 'left'
30
48
  },
31
- // label 宽度
49
+ /**
50
+ * @description label 宽度
51
+ */
32
52
  labelWidth: {
33
53
  type: [String, Number],
34
54
  default: ''
35
55
  },
36
- // label 居中方式,默认 left 取值 left/center/right
56
+ /**
57
+ * @description label 居中方式 取值 left/center/right
58
+ * @values 'left' - label 左侧对齐, 'center' - label 居中, 'right' - label 右侧对齐
59
+ * @default 'left'
60
+ */
37
61
  labelAlign: {
38
62
  type: String,
39
63
  default: 'left'
40
64
  },
65
+ /**
66
+ * @description 是否显示边框
67
+ * @default false
68
+ */
41
69
  border: {
42
70
  type: Boolean,
43
71
  default: false
@@ -38,9 +38,9 @@
38
38
  * @property {String } label 输入框左边的文字提示
39
39
  * @property {Number } labelWidth label的宽度,单位px(默认70)
40
40
  * @property {String } labelAlign = [left|center|right] label的文字对齐方式(默认left)
41
- * @value left label 左侧显示
42
- * @value center label 居中
43
- * @value right label 右侧对齐
41
+ * @value left label 左侧显示
42
+ * @value center label 居中
43
+ * @value right label 右侧对齐
44
44
  * @property {String } message 显示的错误提示内容,如果为空字符串或者false,则不显示错误信息
45
45
  * @property {String } prop 表单域的属性名,在使用校验规则时必填
46
46
  * @property {String } labelPosition = [top|left] label的文字的位置,优先级高于fu-form组件中的labelPosition
@@ -106,18 +106,6 @@
106
106
  }
107
107
 
108
108
  },
109
- // #ifndef VUE3
110
- destroyed() {
111
- if (this.__isUnmounted) return
112
- this.fuInit()
113
- },
114
- // #endif
115
- // #ifdef VUE3
116
- unmounted() {
117
- this.__isUnmounted = true;
118
- this.fuInit()
119
- },
120
- // #endif
121
109
  methods: {
122
110
  /**
123
111
  * 外部调用方法
@@ -373,14 +361,28 @@
373
361
  // 标签对齐方式
374
362
  this.localLabelAlign = this._justifyContent();
375
363
  }
376
- }
364
+ },
365
+ // #ifndef VUE3
366
+ destroyed() {
367
+ if (this.__isUnmounted) return
368
+ this.fuInit()
369
+ },
370
+ // #endif
371
+ // #ifdef VUE3
372
+ unmounted() {
373
+ this.__isUnmounted = true;
374
+ this.fuInit()
375
+ },
376
+ // #endif
377
377
  }
378
378
  </script>
379
379
 
380
380
  <style lang="scss" scoped>
381
+ @import '../../libs/style/components.scss';
382
+
381
383
  .fu-form-item {
384
+ @include flex(row);
382
385
  position: relative;
383
- display: flex;
384
386
  /* #ifdef APP-NVUE */
385
387
  // 在 nvue 中,使用 margin-bottom error 信息会被隐藏
386
388
  padding-bottom: 22px;
@@ -388,26 +390,21 @@
388
390
  /* #ifndef APP-NVUE */
389
391
  margin-bottom: 22px;
390
392
  /* #endif */
391
- flex-direction: row;
392
393
 
393
394
  &__label {
394
- display: flex;
395
- flex-direction: row;
395
+ @include flex(row);
396
396
  align-items: center;
397
397
  text-align: left;
398
398
  font-size: 14px;
399
399
  color: #606266;
400
- height: 36px;
400
+ height: 40px;
401
401
  padding: 0 12px 0 0;
402
402
  /* #ifndef APP-NVUE */
403
403
  vertical-align: middle;
404
- flex-shrink: 0;
405
- /* #endif */
406
-
407
- /* #ifndef APP-NVUE */
404
+ flex: 0 0 auto;
408
405
  box-sizing: border-box;
409
-
410
406
  /* #endif */
407
+
411
408
  &.no-label {
412
409
  padding: 0;
413
410
  }
@@ -436,8 +433,7 @@
436
433
  }
437
434
 
438
435
  & .fu-form-item__nuve-content {
439
- display: flex;
440
- flex-direction: column;
436
+ @include flex(column);
441
437
  flex: 1;
442
438
  }
443
439
 
@@ -481,7 +477,6 @@
481
477
 
482
478
  .fu-form-item__label {
483
479
  padding: 0 0 8px;
484
- line-height: 1.5715;
485
480
  text-align: left;
486
481
  /* #ifndef APP-NVUE */
487
482
  white-space: initial;
@@ -499,7 +494,7 @@
499
494
  .fu-form-item--border {
500
495
  margin-bottom: 0;
501
496
  padding: 10px 0;
502
- border-top: 1px #eee solid;
497
+ border-top: 1px #eeeeee solid;
503
498
 
504
499
  /* #ifndef APP-NVUE */
505
500
  .fu-form-item__content {
@@ -517,8 +512,7 @@
517
512
  /* #endif */
518
513
 
519
514
  /* #ifdef APP-NVUE */
520
- display: flex;
521
- flex-direction: column;
515
+ @include flex(column);
522
516
 
523
517
  .fu-form-item__error {
524
518
  position: relative;
@@ -527,7 +521,6 @@
527
521
  padding-top: 0;
528
522
  margin-top: 5px;
529
523
  }
530
-
531
524
  /* #endif */
532
525
  }
533
526