hy-app 0.2.16 → 0.3.0

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/components/hy-action-sheet/hy-action-sheet.vue +5 -5
  2. package/components/hy-action-sheet/index.scss +6 -1
  3. package/components/hy-address-picker/hy-address-picker.vue +5 -5
  4. package/components/hy-avatar/hy-avatar.vue +5 -5
  5. package/components/hy-back-top/hy-back-top.vue +5 -5
  6. package/components/hy-badge/hy-badge.vue +5 -5
  7. package/components/hy-button/hy-button.vue +5 -5
  8. package/components/hy-calendar/hy-calendar.vue +22 -18
  9. package/components/hy-calendar/typing.d.ts +1 -1
  10. package/components/hy-card/hy-card.vue +5 -5
  11. package/components/hy-cell/hy-cell.vue +10 -11
  12. package/components/hy-check-button/hy-check-button.vue +7 -6
  13. package/components/hy-checkbox/hy-checkbox.vue +14 -14
  14. package/components/hy-code-input/hy-code-input.vue +8 -15
  15. package/components/hy-code-input/index.scss +1 -1
  16. package/components/hy-config-provider/hy-config-provider.vue +8 -6
  17. package/components/hy-count-down/hy-count-down.vue +7 -6
  18. package/components/hy-count-to/hy-count-to.vue +6 -5
  19. package/components/hy-datetime-picker/hy-datetime-picker.vue +7 -7
  20. package/components/hy-divider/hy-divider.vue +10 -7
  21. package/components/hy-dropdown/hy-dropdown.vue +6 -5
  22. package/components/hy-dropdown-item/hy-dropdown-item.vue +7 -5
  23. package/components/hy-empty/hy-empty.vue +6 -5
  24. package/components/hy-float-button/hy-float-button.vue +6 -6
  25. package/components/hy-folding-panel/hy-folding-panel.vue +6 -5
  26. package/components/hy-form/README.md +301 -0
  27. package/components/hy-form/hy-form.vue +252 -533
  28. package/components/hy-form/index.ts +5 -0
  29. package/components/hy-form/typing.d.ts +57 -77
  30. package/components/hy-form-group/hy-form-group.vue +533 -0
  31. package/components/hy-form-group/typing.d.ts +77 -0
  32. package/components/hy-form-item/hy-form-item.vue +199 -0
  33. package/components/hy-form-item/index.scss +41 -0
  34. package/components/hy-form-item/typing.d.ts +43 -0
  35. package/components/hy-grid/hy-grid.vue +11 -13
  36. package/components/hy-grid/typing.d.ts +1 -1
  37. package/components/hy-icon/hy-icon.vue +15 -15
  38. package/components/hy-image/hy-image.vue +15 -9
  39. package/components/hy-input/hy-input.vue +17 -11
  40. package/components/hy-line/hy-line.vue +8 -6
  41. package/components/hy-line-progress/hy-line-progress.vue +9 -16
  42. package/components/hy-list/hy-list.vue +6 -5
  43. package/components/hy-loading/hy-loading.vue +9 -10
  44. package/components/hy-login/TheUserLogin.vue +82 -90
  45. package/components/hy-menu/hy-menu.vue +11 -8
  46. package/components/hy-modal/hy-modal.vue +6 -6
  47. package/components/hy-modal/index.scss +1 -1
  48. package/components/hy-navbar/hy-navbar.vue +6 -6
  49. package/components/hy-notice-bar/hy-notice-bar.vue +14 -9
  50. package/components/hy-notify/hy-notify.vue +6 -6
  51. package/components/hy-number-step/hy-number-step.vue +8 -6
  52. package/components/hy-overlay/hy-overlay.vue +8 -9
  53. package/components/hy-pagination/hy-pagination.vue +11 -8
  54. package/components/hy-picker/hy-picker.vue +9 -9
  55. package/components/hy-popover/hy-popover.vue +11 -7
  56. package/components/hy-popup/hy-popup.vue +9 -7
  57. package/components/hy-price/hy-price.vue +6 -5
  58. package/components/hy-qrcode/hy-qrcode.vue +6 -8
  59. package/components/hy-radio/hy-radio.vue +10 -12
  60. package/components/hy-rate/hy-rate.vue +7 -7
  61. package/components/hy-read-more/hy-read-more.vue +6 -5
  62. package/components/hy-scroll-list/hy-scroll-list.vue +6 -5
  63. package/components/hy-search/hy-search.vue +8 -6
  64. package/components/hy-signature/hy-signature.vue +6 -5
  65. package/components/hy-slider/hy-slider.vue +8 -7
  66. package/components/hy-steps/hy-steps.vue +10 -17
  67. package/components/hy-submit-bar/hy-submit-bar.vue +6 -6
  68. package/components/hy-subsection/hy-subsection.vue +16 -19
  69. package/components/hy-swipe-action/hy-swipe-action.vue +31 -25
  70. package/components/hy-swipe-action/typing.d.ts +1 -1
  71. package/components/hy-swiper/hy-swiper.vue +15 -15
  72. package/components/hy-swiper/typing.d.ts +13 -1
  73. package/components/hy-switch/hy-switch.vue +17 -10
  74. package/components/hy-tabBar/hy-tabBar.vue +35 -26
  75. package/components/hy-tabs/hy-tabs.vue +28 -21
  76. package/components/hy-tag/hy-tag.vue +13 -17
  77. package/components/hy-tag/typing.d.ts +1 -1
  78. package/components/hy-text/hy-text.vue +12 -14
  79. package/components/hy-textarea/hy-textarea.vue +16 -13
  80. package/components/hy-textarea/index.scss +7 -2
  81. package/components/hy-textarea/typing.d.ts +1 -1
  82. package/components/hy-toast/hy-toast.vue +72 -75
  83. package/components/hy-tooltip/hy-tooltip.vue +8 -14
  84. package/components/hy-transition/hy-transition.vue +8 -6
  85. package/components/hy-upload/hy-upload.vue +6 -5
  86. package/components/hy-warn/hy-warn.vue +6 -6
  87. package/components/hy-waterfall/hy-waterfall.vue +8 -7
  88. package/components/hy-watermark/hy-watermark.vue +20 -10
  89. package/components/index.ts +7 -1
  90. package/global.d.ts +3 -1
  91. package/libs/css/common.scss +5 -0
  92. package/libs/css/mixin.scss +2 -1
  93. package/libs/css/vars.css +1 -1
  94. package/package.json +2 -2
  95. package/theme.scss +1 -1
  96. package/utils/inspect.ts +34 -34
  97. package/utils/utils.ts +1 -19
  98. package/web-types.json +1 -1
  99. /package/components/{hy-form → hy-form-group}/index.scss +0 -0
  100. /package/components/{hy-form → hy-form-group}/props.ts +0 -0
@@ -25,11 +25,6 @@
25
25
  </template>
26
26
 
27
27
  <script lang="ts">
28
- /**
29
- * 展示操作或任务的当前进度,比如上传文件,是一个线形的进度条。
30
- * @displayName hy-line-progress
31
- */
32
- defineOptions({})
33
28
  export default {
34
29
  name: 'hy-line-progress',
35
30
  options: {
@@ -41,18 +36,16 @@ export default {
41
36
  </script>
42
37
 
43
38
  <script setup lang="ts">
44
- import {
45
- computed,
46
- type CSSProperties,
47
- getCurrentInstance,
48
- onMounted,
49
- type PropType,
50
- ref,
51
- toRefs,
52
- watch,
53
- } from 'vue'
39
+ import { computed, getCurrentInstance, onMounted, ref, toRefs, watch } from 'vue'
40
+ import type { CSSProperties, PropType } from 'vue'
54
41
  import { addUnit, getPx, getRect, range, sleep } from '../../utils'
55
42
 
43
+ /**
44
+ * 展示操作或任务的当前进度,比如上传文件,是一个线形的进度条。
45
+ * @displayName hy-line-progress
46
+ */
47
+ defineOptions({})
48
+
56
49
  // const props = withDefaults(defineProps<IProps>(), defaultProps);
57
50
  const props = defineProps({
58
51
  /** 激活部分的颜色 */
@@ -67,7 +60,7 @@ const props = defineProps({
67
60
  /** 是否在进度条内部显示百分比的值 */
68
61
  showText: {
69
62
  type: Boolean,
70
- default: false,
63
+ default: true,
71
64
  },
72
65
  /** 进度条的高度,单位px */
73
66
  height: {
@@ -62,11 +62,6 @@
62
62
  </template>
63
63
 
64
64
  <script lang="ts">
65
- /**
66
- * 实现只展示可视内容的dom,减少dom创建,优化滚动性能
67
- * @displayName hy-list
68
- */
69
- defineOptions({})
70
65
  export default {
71
66
  name: 'hy-list',
72
67
  options: {
@@ -93,6 +88,12 @@ import {
93
88
  import { addUnit, getPx, getRect } from '../../utils'
94
89
  import type { IListEmits } from './typing'
95
90
 
91
+ /**
92
+ * 实现只展示可视内容的dom,减少dom创建,优化滚动性能
93
+ * @displayName hy-list
94
+ */
95
+ defineOptions({})
96
+
96
97
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
97
98
  const props = defineProps({
98
99
  /** 数据列表 */
@@ -43,11 +43,6 @@
43
43
  </template>
44
44
 
45
45
  <script lang="ts">
46
- /**
47
- * 目前用在华玥的loadMore加载更多等组件的正在加载状态场景。
48
- * @displayName hy-loading
49
- */
50
- defineOptions({})
51
46
  export default {
52
47
  name: 'hy-loading',
53
48
  options: {
@@ -63,6 +58,12 @@ import { toRefs, ref, computed } from 'vue'
63
58
  import type { CSSProperties, PropType } from 'vue'
64
59
  import { addUnit, colorGradient } from '../../utils'
65
60
 
61
+ /**
62
+ * 目前用在华玥的loadMore加载更多等组件的正在加载状态场景。
63
+ * @displayName hy-loading
64
+ */
65
+ defineOptions({})
66
+
66
67
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
67
68
  const props = defineProps({
68
69
  /** 是否显示组件 */
@@ -92,12 +93,12 @@ const props = defineProps({
92
93
  },
93
94
  /** 加载图标的大小,单位px */
94
95
  size: {
95
- type: Number,
96
+ type: [String, Number],
96
97
  default: 24,
97
98
  },
98
99
  /** 文字大小 */
99
100
  textSize: {
100
- type: Number,
101
+ type: [String, Number],
101
102
  default: 15,
102
103
  },
103
104
  /** 文字内容 */
@@ -115,9 +116,7 @@ const props = defineProps({
115
116
  /** mode=circle时的暗边颜色 */
116
117
  inactiveColor: String,
117
118
  /** 定义需要用到的外部样式 */
118
- customStyle: {
119
- type: Object as PropType<CSSProperties>,
120
- },
119
+ customStyle: Object as PropType<CSSProperties>,
121
120
  })
122
121
  const { show, size, color, mode, inactiveColor } = toRefs(props)
123
122
 
@@ -21,52 +21,52 @@
21
21
  </template>
22
22
 
23
23
  <script setup lang="ts">
24
- import { ref, reactive, onMounted, computed } from "vue";
25
- import { onHide } from "@dcloudio/uni-app";
26
- import { storeToRefs } from "pinia";
27
- import { useUserInfo } from "../../store";
28
- import { decryptData, encryptData } from "../../utils";
29
- import { FormTypeEnum } from "../../typing";
30
- import { IconConfig } from "../../config";
31
- import type { UserLoginInfoVo } from "./typing";
24
+ import { ref, reactive, onMounted, computed } from 'vue'
25
+ import { onHide } from '@dcloudio/uni-app'
26
+ import { storeToRefs } from 'pinia'
27
+ import { useUserInfo } from '../../store'
28
+ import { decryptData, encryptData } from '../../utils'
29
+ import { FormTypeEnum } from '../../typing'
30
+ import { IconConfig } from '../../config'
31
+ import type { UserLoginInfoVo } from './typing'
32
32
 
33
33
  // 组件
34
- import HyCheckbox from "../hy-checkbox/hy-checkbox.vue";
35
- import HyForm from "../hy-form/hy-form.vue";
34
+ import HyCheckbox from '../hy-checkbox/hy-checkbox.vue'
35
+ import HyForm from '@/package/components/hy-form-group/hy-form.vue'
36
36
 
37
37
  interface IProps {
38
- themeColor: string;
39
- prefix: string;
40
- isShowPwd: boolean;
41
- userPlaceholder: string;
42
- pwdPlaceholder: string;
43
- customUserValidator: Record<string, any>;
44
- customPwdValidator: Record<string, any>;
45
- userNumValidator: Record<string, any>;
46
- pwdNumValidator: Record<string, any>;
38
+ themeColor: string
39
+ prefix: string
40
+ isShowPwd: boolean
41
+ userPlaceholder: string
42
+ pwdPlaceholder: string
43
+ customUserValidator: Record<string, any>
44
+ customPwdValidator: Record<string, any>
45
+ userNumValidator: Record<string, any>
46
+ pwdNumValidator: Record<string, any>
47
47
  }
48
48
 
49
49
  const props = withDefaults(defineProps<IProps>(), {
50
- themeColor: "",
51
- prefix: "hy",
50
+ themeColor: '',
51
+ prefix: 'hy',
52
52
  isShowPwd: false,
53
- userPlaceholder: "",
54
- pwdPlaceholder: "",
53
+ userPlaceholder: '',
54
+ pwdPlaceholder: '',
55
55
  customUserValidator: () => ({}),
56
56
  customPwdValidator: () => ({}),
57
57
  userNumValidator: () => ({}),
58
58
  pwdNumValidator: () => ({}),
59
- });
60
- const emit = defineEmits(["handleHistory", "handleCheckbox"]);
61
- const userInfoStore = useUserInfo();
62
- const { userForm, choiceList, rememberPsw } = storeToRefs(userInfoStore);
59
+ })
60
+ const emit = defineEmits(['handleHistory', 'handleCheckbox'])
61
+ const userInfoStore = useUserInfo()
62
+ const { userForm, choiceList, rememberPsw } = storeToRefs(userInfoStore)
63
63
 
64
- const showChoice = ref<boolean>(false);
65
- const showPwd = ref<boolean>(false);
64
+ const showChoice = ref<boolean>(false)
65
+ const showPwd = ref<boolean>(false)
66
66
  const userColumns = computed(() => [
67
67
  {
68
- field: "userName",
69
- label: "",
68
+ field: 'userName',
69
+ label: '',
70
70
  type: FormTypeEnum.TEXT,
71
71
  input: {
72
72
  clearable: true,
@@ -76,20 +76,18 @@ const userColumns = computed(() => [
76
76
  color: props.themeColor,
77
77
  },
78
78
  suffixIcon: {
79
- name: showChoice.value
80
- ? IconConfig.ARROW_UP_FILL
81
- : IconConfig.ARROW_DOWN_FILL,
79
+ name: showChoice.value ? IconConfig.ARROW_UP_FILL : IconConfig.ARROW_DOWN_FILL,
82
80
  color: props.themeColor,
83
81
  },
84
82
  onSuffix: () => {
85
- showChoice.value = !showChoice.value;
83
+ showChoice.value = !showChoice.value
86
84
  },
87
85
  },
88
86
  rules: [props.customUserValidator, props.userNumValidator],
89
87
  },
90
88
  {
91
- field: "password",
92
- label: "",
89
+ field: 'password',
90
+ label: '',
93
91
  type: showPwd.value ? FormTypeEnum.TEXT : FormTypeEnum.PASSWORD,
94
92
  input: {
95
93
  clearable: true,
@@ -103,22 +101,22 @@ const userColumns = computed(() => [
103
101
  color: props.themeColor,
104
102
  },
105
103
  onSuffix: () => {
106
- showPwd.value = !showPwd.value;
104
+ showPwd.value = !showPwd.value
107
105
  },
108
106
  },
109
107
  rules: [props.customUserValidator, props.pwdNumValidator],
110
108
  },
111
- ]);
112
- const rememberList = reactive([{ label: "记住密码", value: 1 }]);
113
- const form_1Ref = ref<InstanceType<typeof HyForm>>();
109
+ ])
110
+ const rememberList = reactive([{ label: '记住密码', value: 1 }])
111
+ const form_1Ref = ref<InstanceType<typeof HyForm>>()
114
112
  // 效验用户名和密码
115
113
  const userRules = reactive({
116
114
  userName: [
117
115
  {
118
116
  required: true,
119
- message: "请先输入账号",
117
+ message: '请先输入账号',
120
118
  // 可以单个或者同时写两个触发验证方式
121
- trigger: ["blur", "change"],
119
+ trigger: ['blur', 'change'],
122
120
  },
123
121
  props.customUserValidator,
124
122
  props.userNumValidator,
@@ -126,44 +124,44 @@ const userRules = reactive({
126
124
  password: [
127
125
  {
128
126
  required: true,
129
- message: "请输入密码",
127
+ message: '请输入密码',
130
128
  // 可以单个或者同时写两个触发验证方式
131
- trigger: ["blur", "change"],
129
+ trigger: ['blur', 'change'],
132
130
  },
133
131
  props.pwdNumValidator,
134
132
  props.customPwdValidator,
135
133
  ],
136
- });
137
- const rememberPassword = ref(false);
138
- const account = uni.getStorageSync(`${props.prefix}_account`);
139
- const accountList = uni.getStorageSync(`${props.prefix}_choiceList`);
134
+ })
135
+ const rememberPassword = ref(false)
136
+ const account = uni.getStorageSync(`${props.prefix}_account`)
137
+ const accountList = uni.getStorageSync(`${props.prefix}_choiceList`)
140
138
 
141
139
  onMounted(() => {
142
- if (!account) return;
143
- const result = decryptData(account);
144
- console.log(result);
140
+ if (!account) return
141
+ const result = decryptData(account)
142
+ console.log(result)
145
143
  //有缓存就赋值给文本没有就清空
146
- rememberPsw.value = result?.rememberPsw;
144
+ rememberPsw.value = result?.rememberPsw
147
145
  //获取缓存的账号和密码
148
- userForm.value.userName = result?.userName;
149
- userForm.value.password = result?.password;
146
+ userForm.value.userName = result?.userName
147
+ userForm.value.password = result?.password
150
148
 
151
149
  if (accountList) {
152
- choiceList.value = decryptData(accountList) as UserLoginInfoVo[];
150
+ choiceList.value = decryptData(accountList) as UserLoginInfoVo[]
153
151
  }
154
- });
152
+ })
155
153
 
156
154
  onHide(() => {
157
155
  // if (!account) return;
158
156
  //获取缓存的账号和密码
159
- const { userName, password } = decryptData(account);
157
+ const { userName, password } = decryptData(account)
160
158
  if (choiceList.value.length) {
161
159
  // 过滤数判断是否有一样的账号
162
160
  const filterArr = choiceList.value.filter((item) => {
163
- return item.user === userName;
164
- });
161
+ return item.user === userName
162
+ })
165
163
  // 有一样的账号退出函数不执行下面的
166
- if (filterArr.length) return;
164
+ if (filterArr.length) return
167
165
  }
168
166
  // 判断是否有保存账号和密码
169
167
  if (userName && password) {
@@ -171,17 +169,14 @@ onHide(() => {
171
169
  choiceList.value.unshift({
172
170
  user: userName,
173
171
  pwd: password,
174
- });
172
+ })
175
173
  // 数组最多只放三个账号
176
174
  if (choiceList.value.length >= 5) {
177
- choiceList.value.splice(5, 1);
175
+ choiceList.value.splice(5, 1)
178
176
  }
179
- uni.setStorageSync(
180
- `${props.prefix}_choiceList`,
181
- encryptData(choiceList.value),
182
- );
177
+ uni.setStorageSync(`${props.prefix}_choiceList`, encryptData(choiceList.value))
183
178
  }
184
- });
179
+ })
185
180
 
186
181
  /**
187
182
  * 登录效验
@@ -191,30 +186,30 @@ const loginFn = () => {
191
186
  form_1Ref.value
192
187
  ?.handleSubmit()
193
188
  .then((res) => {
194
- resolve("success" + res);
189
+ resolve('success' + res)
195
190
  })
196
191
  .catch((err) => {
197
- reject("error" + err);
198
- });
199
- });
200
- };
192
+ reject('error' + err)
193
+ })
194
+ })
195
+ }
201
196
 
202
197
  /**
203
198
  * 勾选是否记住密码
204
199
  * */
205
200
  const checkboxChange = () => {
206
- emit("handleCheckbox", rememberPassword.value);
207
- };
201
+ emit('handleCheckbox', rememberPassword.value)
202
+ }
208
203
 
209
204
  /**
210
205
  * 选择历史账号
211
206
  * */
212
207
  const btnChoiceClick = (index: number) => {
213
- showChoice.value = false;
214
- userForm.value.name = choiceList.value[index].user;
215
- userForm.value.pwd = choiceList.value[index].pwd;
216
- emit("handleHistory");
217
- };
208
+ showChoice.value = false
209
+ userForm.value.name = choiceList.value[index].user
210
+ userForm.value.pwd = choiceList.value[index].pwd
211
+ emit('handleHistory')
212
+ }
218
213
 
219
214
  /**
220
215
  * 长按操作历史账户
@@ -224,21 +219,18 @@ const btnChoiceClick = (index: number) => {
224
219
  const extensionFun = (index: number, username: string) => {
225
220
  switch (index) {
226
221
  case 0:
227
- const i = choiceList.value.findIndex((item) => item.user === username);
228
- choiceList.value.splice(i, 1);
229
- uni.setStorageSync(
230
- `${props.prefix}_choiceList`,
231
- encryptData(choiceList.value),
232
- );
233
- break;
222
+ const i = choiceList.value.findIndex((item) => item.user === username)
223
+ choiceList.value.splice(i, 1)
224
+ uni.setStorageSync(`${props.prefix}_choiceList`, encryptData(choiceList.value))
225
+ break
234
226
  default:
235
- break;
227
+ break
236
228
  }
237
- };
229
+ }
238
230
 
239
231
  defineExpose({
240
232
  loginFn,
241
- });
233
+ })
242
234
  </script>
243
235
 
244
236
  <style lang="scss" scoped>
@@ -43,11 +43,6 @@
43
43
  </template>
44
44
 
45
45
  <script lang="ts">
46
- /**
47
- * 垂直展示的导航栏,用于在不同的内容区域之间进行切换。
48
- * @displayName hy-menu
49
- */
50
- defineOptions({})
51
46
  export default {
52
47
  name: 'hy-menu',
53
48
  options: {
@@ -59,21 +54,27 @@ export default {
59
54
  </script>
60
55
 
61
56
  <script lang="ts" setup>
62
- import { computed, PropType, ref, toRefs, watch } from 'vue'
57
+ import { computed, ref, toRefs, watch } from 'vue'
58
+ import type { CSSProperties, PropType } from 'vue'
63
59
  import type { IMenuEmits, MenusType } from './typing'
64
60
  import { addUnit } from '../../utils'
65
61
 
66
62
  import type HyBadgeProps from '../hy-badge/typing'
67
63
  import type HyIconProps from '../hy-icon/typing'
68
-
69
64
  // 组件
70
65
  import HyIcon from '../hy-icon/hy-icon.vue'
71
66
  import HyBadge from '../hy-badge/hy-badge.vue'
72
67
 
68
+ /**
69
+ * 垂直展示的导航栏,用于在不同的内容区域之间进行切换。
70
+ * @displayName hy-menu
71
+ */
72
+ defineOptions({})
73
+
73
74
  // const props = withDefaults(defineProps<IProps>(), defaultProps);
74
75
  const props = defineProps({
75
76
  /** 当前值 */
76
- modelValue: String,
77
+ modelValue: [String, Number],
77
78
  /** 菜单数据集 */
78
79
  list: {
79
80
  type: Array as PropType<Array<MenusType>>,
@@ -96,6 +97,8 @@ const props = defineProps({
96
97
  type: Object as PropType<HyBadgeProps>,
97
98
  default: {},
98
99
  },
100
+ /** 定义需要用到的外部样式 */
101
+ customStyle: Object as PropType<CSSProperties>,
99
102
  })
100
103
  const { modelValue, list, color } = toRefs(props)
101
104
  const emit = defineEmits<IMenuEmits>()
@@ -88,11 +88,6 @@
88
88
  </template>
89
89
 
90
90
  <script lang="ts">
91
- /**
92
- * 弹出模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作。
93
- * @displayName hy-modal
94
- */
95
- defineOptions({})
96
91
  export default {
97
92
  name: 'hy-modal',
98
93
  options: {
@@ -107,11 +102,16 @@ export default {
107
102
  import { ref, toRefs, watch } from 'vue'
108
103
  import type { IModalEmits } from './typing'
109
104
  import { addUnit } from '../../utils'
110
-
111
105
  // 组件
112
106
  import HyPopup from '../hy-popup/hy-popup.vue'
113
107
  import HyLoading from '../hy-loading/hy-loading.vue'
114
108
 
109
+ /**
110
+ * 弹出模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作。
111
+ * @displayName hy-modal
112
+ */
113
+ defineOptions({})
114
+
115
115
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
116
116
  const props = defineProps({
117
117
  /** 是否显示模态框 */
@@ -78,7 +78,7 @@
78
78
  /* 取消 */
79
79
  &--cancel {
80
80
  //background-color: $hy-background--empty;
81
- background-color: #323233;
81
+ background-color: $hy-background--empty;
82
82
 
83
83
  &-text {
84
84
  color: $hy-text-color;
@@ -84,11 +84,6 @@
84
84
  </template>
85
85
 
86
86
  <script lang="ts">
87
- /**
88
- * 一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uni-app带的导航栏。
89
- * @displayName hy-navbar
90
- */
91
- defineOptions({})
92
87
  export default {
93
88
  name: 'hy-navbar',
94
89
  options: {
@@ -105,11 +100,16 @@ import type { CSSProperties, PropType } from 'vue'
105
100
  import type { INavbarEmits } from './typing'
106
101
  import { addUnit, getPx, getWindowInfo } from '../../utils'
107
102
  import { IconConfig } from '../../config'
108
-
109
103
  // 组件
110
104
  import HyIcon from '../hy-icon/hy-icon.vue'
111
105
  import HyStatusBar from '../hy-status-bar/hy-status-bar.vue'
112
106
 
107
+ /**
108
+ * 一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uni-app带的导航栏。
109
+ * @displayName hy-navbar
110
+ */
111
+ defineOptions({})
112
+
113
113
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
114
114
  const props = defineProps({
115
115
  /** 是否开启顶部安全区适配 */
@@ -44,11 +44,6 @@
44
44
  </template>
45
45
 
46
46
  <script lang="ts">
47
- /**
48
- * 该组件用于滚动通告场景,有多种模式可供选择
49
- * @displayName hy-notice-bar
50
- */
51
- defineOptions({})
52
47
  export default {
53
48
  name: 'hy-notice-bar',
54
49
  options: {
@@ -61,20 +56,26 @@ export default {
61
56
 
62
57
  <script setup lang="ts">
63
58
  import { ref, toRefs } from 'vue'
64
- import type { INoticeBarEmits } from './typing'
59
+ import type { PropType, CSSProperties } from 'vue'
60
+ import { INoticeBarEmits, NoticeBarModeVo } from './typing'
65
61
  import { IconConfig } from '../../config'
66
-
67
62
  // 组件
68
63
  import HyRowNotice from './hy-row-notice.vue'
69
64
  import HyColumnNotice from './hy-column-notice.vue'
70
65
 
66
+ /**
67
+ * 该组件用于滚动通告场景,有多种模式可供选择
68
+ * @displayName hy-notice-bar
69
+ */
70
+ defineOptions({})
71
+
71
72
  const show = ref(true)
72
73
 
73
74
  // const props = withDefaults(defineProps<IProps>(), defaultProps);
74
75
  const props = defineProps({
75
76
  /** 显示的内容,数组 */
76
77
  text: {
77
- type: [String, Array],
78
+ type: [String, Array] as PropType<string | string[]>,
78
79
  default: [],
79
80
  },
80
81
  /**
@@ -99,7 +100,7 @@ const props = defineProps({
99
100
  * 通告模式,link-显示右箭头,closable-显示右侧关闭图标
100
101
  * @values link,closable
101
102
  * */
102
- mode: String,
103
+ mode: String as PropType<NoticeBarModeVo>,
103
104
  /** 文字颜色,各图标也会使用文字颜色 */
104
105
  color: String,
105
106
  /** 背景颜色 */
@@ -142,6 +143,10 @@ const props = defineProps({
142
143
  },
143
144
  /** 跳转地址 */
144
145
  url: String,
146
+ /** 定义需要用到的外部样式 */
147
+ customStyle: Object as PropType<CSSProperties>,
148
+ /** 自定义外部类名 */
149
+ customClass: String,
145
150
  })
146
151
  const { mode, linkType, url } = toRefs(props)
147
152
  const emit = defineEmits<INoticeBarEmits>()
@@ -30,11 +30,6 @@
30
30
  </template>
31
31
 
32
32
  <script lang="ts">
33
- /**
34
- * 一般用于页面顶部向下滑出一个提示,尔后自动收起的场景。
35
- * @displayName hy-notify
36
- */
37
- defineOptions({})
38
33
  export default {
39
34
  name: 'hy-notify',
40
35
  options: {
@@ -50,13 +45,18 @@ import type IProps from './typing'
50
45
  import { computed, ref } from 'vue'
51
46
  import type { CSSProperties, PropType } from 'vue'
52
47
  import { IconConfig } from '../../config'
53
-
54
48
  import { addUnit } from '../../utils'
55
49
  // 组件
56
50
  import HyTransition from '../hy-transition/hy-transition.vue'
57
51
  import HyStatusBar from '../hy-status-bar/hy-status-bar.vue'
58
52
  import HyIcon from '../hy-icon/hy-icon.vue'
59
53
 
54
+ /**
55
+ * 一般用于页面顶部向下滑出一个提示,尔后自动收起的场景。
56
+ * @displayName hy-notify
57
+ */
58
+ defineOptions({})
59
+
60
60
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
61
61
  const props = defineProps({
62
62
  /** 到顶部的距离 */
@@ -126,11 +126,6 @@
126
126
  </template>
127
127
 
128
128
  <script lang="ts">
129
- /**
130
- * 一般用于商城购物选择物品数量的场景
131
- * @displayName hy-number-step
132
- */
133
- defineOptions({})
134
129
  export default {
135
130
  name: 'hy-number-step',
136
131
  options: {
@@ -146,9 +141,16 @@ import { computed, toRefs, ref, watch, onMounted, nextTick } from 'vue'
146
141
  import type { CSSProperties, PropType } from 'vue'
147
142
  import { addUnit } from '../../utils'
148
143
  import { IconConfig } from '../../config'
149
- import HyIcon from '../hy-icon/hy-icon.vue'
150
144
  import type HyIconProps from '../hy-icon/typing'
151
145
  import type { INumberStepEmits } from './typing'
146
+ // 组件
147
+ import HyIcon from '../hy-icon/hy-icon.vue'
148
+
149
+ /**
150
+ * 一般用于商城购物选择物品数量的场景
151
+ * @displayName hy-number-step
152
+ */
153
+ defineOptions({})
152
154
 
153
155
  // const props = withDefaults(defineProps<IProps>(), defaultProps)
154
156
  const props = defineProps({