uview-pro 0.5.0 → 0.5.1

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.
package/changelog.md CHANGED
@@ -1,27 +1,38 @@
1
- ## 0.5.0(2026-01-14
1
+ ## 0.5.1(2026-01-15
2
2
 
3
3
  ### ✨ Features | 新功能
4
4
 
5
- - **locale:** 添加组件国际化支持和 use locale hooks ([ff96211](https://github.com/anyup/uView-Pro/commit/ff96211423d27bde350a2ea4b9f1d5a5eb72d604))
6
- - **locale:** 添加中、英文国际化语言字段支持 ([257eb41](https://github.com/anyup/uView-Pro/commit/257eb4143ac39cab4940ab76844d0c3be02b198c))
7
- - **locale:** 所有组件实现组件国际化显示替换 ([ef52ff7](https://github.com/anyup/uView-Pro/commit/ef52ff7669c8cb7389377b8bdd4da681dddbb0a6))
8
- - **locale:** 跟随vue-i18n国际化语言切换功能 ([cccecb0](https://github.com/anyup/uView-Pro/commit/cccecb03763990689e6e66d856cf3588157a61b6))
9
- - **fullScreen:** 优化fullscreen页面配置和实现,支持国际化 ([8518218](https://github.com/anyup/uView-Pro/commit/85182186848fa6443ed74de9af1e3f5cd15fa724))
10
- - **locale:** 新增locale国际化和vue-i18n切换示例页面 ([da79723](https://github.com/anyup/uView-Pro/commit/da797230005ff130ea66c315921e4d8d9fa613c1))
11
- - **demo-page:** 添加支付宝小程序navbar兼容性处理 ([75284a4](https://github.com/anyup/uView-Pro/commit/75284a403b9eb7dee9625279ca5cadd14bba3a63))
12
- - **u-skeleton:** 重构u-skeleton骨架屏组件实现全新设计 ([c39405d](https://github.com/anyup/uView-Pro/commit/c39405dfd8c4e1fe06fd842efde79ebf6706b0d1))
13
- - **u-tabbar:** 重构u-tabbar组件内部结构,增加图标文字间距配置 ([e5655da](https://github.com/anyup/uView-Pro/commit/e5655da55c515a8288b12e37084dfec093da542b))
14
- - **mp-weixin:** 添加小程序全局分享功能 ([e4f8bf5](https://github.com/anyup/uView-Pro/commit/e4f8bf5baae237e8dc443de7c90cd751ef045101))
15
- - **useLocale:** uselocale hooks 支持命名空间功能 ([4d6e8f2](https://github.com/anyup/uView-Pro/commit/4d6e8f26976725cfdf862bd21af3648b864fdc29))
16
- - **u-tabbar:** 优化u-tabbar文本样式渲染优先级 ([7d73861](https://github.com/anyup/uView-Pro/commit/7d73861b4cbe1266bc4cbfff31b45a57d9ed960f))
17
- - **locale:** 初始化多语言时添加 isForce 参数支持强制设置默认语言 ([3309017](https://github.com/anyup/uView-Pro/commit/3309017e6fea3bc00f10efcec9f3ec3f83de9a88))
18
- - **demo:** 优化国际化配置示例并添加多语言支持 ([177b978](https://github.com/anyup/uView-Pro/commit/177b97869f14023daf4bca632093076716b616d6))
19
- - **theme:** 主题配置支持强制初始化功能 ([95c895d](https://github.com/anyup/uView-Pro/commit/95c895d0cfb1df37aa6285b88a2247f83add7361))
5
+ - **locale:** 统一组件国际化命名空间,以保持命名的一致性并避免与自定义字段时冲突 ([8bd3cc3](https://github.com/anyup/uView-Pro/commit/8bd3cc32b26349da63f5005cb3c29e575c831142))
6
+ - **u-form:** 支持label插槽功能 ([f82994f](https://github.com/anyup/uView-Pro/commit/f82994f5500ec4509dff64c05e115afb0465d4a2))
20
7
 
21
8
  ### 👥 Contributors
22
9
 
23
10
  <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
24
11
 
12
+ ## 0.5.0(2026-01-14)
13
+
14
+ ### ✨ Features | 新功能
15
+
16
+ - **locale:** 添加组件国际化支持和 use locale hooks ([ff96211](https://github.com/anyup/uView-Pro/commit/ff96211423d27bde350a2ea4b9f1d5a5eb72d604))
17
+ - **locale:** 添加中、英文国际化语言字段支持 ([257eb41](https://github.com/anyup/uView-Pro/commit/257eb4143ac39cab4940ab76844d0c3be02b198c))
18
+ - **locale:** 所有组件实现组件国际化显示替换 ([ef52ff7](https://github.com/anyup/uView-Pro/commit/ef52ff7669c8cb7389377b8bdd4da681dddbb0a6))
19
+ - **locale:** 跟随vue-i18n国际化语言切换功能 ([cccecb0](https://github.com/anyup/uView-Pro/commit/cccecb03763990689e6e66d856cf3588157a61b6))
20
+ - **fullScreen:** 优化fullscreen页面配置和实现,支持国际化 ([8518218](https://github.com/anyup/uView-Pro/commit/85182186848fa6443ed74de9af1e3f5cd15fa724))
21
+ - **locale:** 新增locale国际化和vue-i18n切换示例页面 ([da79723](https://github.com/anyup/uView-Pro/commit/da797230005ff130ea66c315921e4d8d9fa613c1))
22
+ - **demo-page:** 添加支付宝小程序navbar兼容性处理 ([75284a4](https://github.com/anyup/uView-Pro/commit/75284a403b9eb7dee9625279ca5cadd14bba3a63))
23
+ - **u-skeleton:** 重构u-skeleton骨架屏组件实现全新设计 ([c39405d](https://github.com/anyup/uView-Pro/commit/c39405dfd8c4e1fe06fd842efde79ebf6706b0d1))
24
+ - **u-tabbar:** 重构u-tabbar组件内部结构,增加图标文字间距配置 ([e5655da](https://github.com/anyup/uView-Pro/commit/e5655da55c515a8288b12e37084dfec093da542b))
25
+ - **mp-weixin:** 添加小程序全局分享功能 ([e4f8bf5](https://github.com/anyup/uView-Pro/commit/e4f8bf5baae237e8dc443de7c90cd751ef045101))
26
+ - **useLocale:** uselocale hooks 支持命名空间功能 ([4d6e8f2](https://github.com/anyup/uView-Pro/commit/4d6e8f26976725cfdf862bd21af3648b864fdc29))
27
+ - **u-tabbar:** 优化u-tabbar文本样式渲染优先级 ([7d73861](https://github.com/anyup/uView-Pro/commit/7d73861b4cbe1266bc4cbfff31b45a57d9ed960f))
28
+ - **locale:** 初始化多语言时添加 isForce 参数支持强制设置默认语言 ([3309017](https://github.com/anyup/uView-Pro/commit/3309017e6fea3bc00f10efcec9f3ec3f83de9a88))
29
+ - **demo:** 优化国际化配置示例并添加多语言支持 ([177b978](https://github.com/anyup/uView-Pro/commit/177b97869f14023daf4bca632093076716b616d6))
30
+ - **theme:** 主题配置支持强制初始化功能 ([95c895d](https://github.com/anyup/uView-Pro/commit/95c895d0cfb1df37aa6285b88a2247f83add7361))
31
+
32
+ ### 👥 Contributors
33
+
34
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
35
+
25
36
  ## 0.4.13(2026-01-06)
26
37
 
27
38
  ### ✨ Features | 新功能
@@ -34,7 +34,7 @@ export const ActionSheetProps = {
34
34
  /** 弹出的z-index值 */
35
35
  zIndex: { type: [String, Number], default: 0 },
36
36
  /** 取消按钮的文字提示 */
37
- cancelText: { type: String, default: () => t('actionSheet.cancelText') },
37
+ cancelText: { type: String, default: () => t('uActionSheet.cancelText') },
38
38
  /** 字体颜色 */
39
39
  color: { type: String, default: () => getColor('mainColor') },
40
40
  /** 字体大小 */
@@ -50,9 +50,9 @@ export const CalendarProps = {
50
50
  /** 范围内日期字体颜色 */
51
51
  rangeColor: { type: String, default: () => getColor('primary') },
52
52
  /** mode=range时生效,起始日期自定义文案 */
53
- startText: { type: String, default: () => t('calendar.startText') },
53
+ startText: { type: String, default: () => t('uCalendar.startText') },
54
54
  /** mode=range时生效,结束日期自定义文案 */
55
- endText: { type: String, default: () => t('calendar.endText') },
55
+ endText: { type: String, default: () => t('uCalendar.endText') },
56
56
  /** 按钮样式类型 */
57
57
  btnType: { type: String as PropType<ThemeType>, default: 'primary' },
58
58
  /** 当前选中日期带选中效果 */
@@ -62,7 +62,7 @@ export const CalendarProps = {
62
62
  /** 是否显示右上角的关闭图标 */
63
63
  closeable: { type: Boolean, default: true },
64
64
  /** 顶部的提示文字 */
65
- toolTip: { type: String, default: () => t('calendar.toolTip') },
65
+ toolTip: { type: String, default: () => t('uCalendar.toolTip') },
66
66
  /** 是否显示农历 */
67
67
  showLunar: { type: Boolean, default: false },
68
68
  /** 是否在页面中显示 */
@@ -223,11 +223,11 @@
223
223
  <view class="u-calendar__bottom">
224
224
  <view class="u-calendar__bottom__choose">
225
225
  <text>{{ mode == 'date' ? activeDate : startDate }}</text>
226
- <text v-if="endDate">{{ t('calendar.to') }}{{ endDate }}</text>
226
+ <text v-if="endDate">{{ t('uCalendar.to') }}{{ endDate }}</text>
227
227
  </view>
228
228
  <view class="u-calendar__bottom__btn">
229
229
  <u-button :type="btnType" shape="circle" size="default" @click="btnFix(false)">
230
- {{ t('calendar.confirmText') }}
230
+ {{ t('uCalendar.confirmText') }}
231
231
  </u-button>
232
232
  </view>
233
233
  </view>
@@ -317,13 +317,13 @@ const isStart = ref(true);
317
317
  const min = ref<{ year: number; month: number; day: number } | null>(null);
318
318
  const max = ref<{ year: number; month: number; day: number } | null>(null);
319
319
  const weekDayZh = ref([
320
- t('calendar.sun'),
321
- t('calendar.mon'),
322
- t('calendar.tue'),
323
- t('calendar.wed'),
324
- t('calendar.thu'),
325
- t('calendar.fri'),
326
- t('calendar.sat')
320
+ t('uCalendar.sun'),
321
+ t('uCalendar.mon'),
322
+ t('uCalendar.tue'),
323
+ t('uCalendar.wed'),
324
+ t('uCalendar.thu'),
325
+ t('uCalendar.fri'),
326
+ t('uCalendar.sat')
327
327
  ]);
328
328
 
329
329
  const dataChange = computed(() => `${props.mode}-${props.minDate}-${props.maxDate}`);
@@ -455,7 +455,7 @@ function getWeekday(yearNum: number, monthNum: number) {
455
455
  function checkRange(yearNum: number) {
456
456
  let overstep = false;
457
457
  if (yearNum < Number(props.minYear) || yearNum > Number(props.maxYear)) {
458
- uni.showToast({ title: t('calendar.outOfRange'), icon: 'none' });
458
+ uni.showToast({ title: t('uCalendar.outOfRange'), icon: 'none' });
459
459
  overstep = true;
460
460
  }
461
461
  return overstep;
@@ -503,7 +503,7 @@ function changeData() {
503
503
  daysArr.value = generateArray(1, days.value);
504
504
  weekday.value = getWeekday(year.value, month.value);
505
505
  weekdayArr.value = generateArray(1, weekday.value);
506
- showTitle.value = `${year.value}${t('calendar.year')}${month.value}${t('calendar.month')}`;
506
+ showTitle.value = `${year.value}${t('uCalendar.year')}${month.value}${t('uCalendar.month')}`;
507
507
  if (props.showLunar) {
508
508
  lunarArr.value = [];
509
509
  daysArr.value.forEach(d => {
@@ -18,7 +18,7 @@
18
18
  }"
19
19
  v-if="props.showDays && (props.hideZeroDay || (!props.hideZeroDay && d != '00'))"
20
20
  >
21
- {{ props.separator == 'colon' && props.showHours ? ':' : t('countDown.day') }}
21
+ {{ props.separator == 'colon' && props.showHours ? ':' : t('uCountDown.day') }}
22
22
  </view>
23
23
  <view class="u-countdown-item" :style="$u.toStyle(itemStyle)" v-if="props.showHours">
24
24
  <view class="u-countdown-time" :style="{ fontSize: props.fontSize + 'rpx', color: props.color }">
@@ -34,7 +34,7 @@
34
34
  }"
35
35
  v-if="props.showHours"
36
36
  >
37
- {{ props.separator == 'colon' && props.showMinutes ? ':' : t('countDown.hour') }}
37
+ {{ props.separator == 'colon' && props.showMinutes ? ':' : t('uCountDown.hour') }}
38
38
  </view>
39
39
  <view class="u-countdown-item" :style="$u.toStyle(itemStyle)" v-if="props.showMinutes">
40
40
  <view class="u-countdown-time" :style="{ fontSize: props.fontSize + 'rpx', color: props.color }">
@@ -50,7 +50,7 @@
50
50
  }"
51
51
  v-if="props.showMinutes"
52
52
  >
53
- {{ props.separator == 'colon' && props.showSeconds ? ':' : t('countDown.minute') }}
53
+ {{ props.separator == 'colon' && props.showSeconds ? ':' : t('uCountDown.minute') }}
54
54
  </view>
55
55
  <view class="u-countdown-item" :style="$u.toStyle(itemStyle)" v-if="props.showSeconds">
56
56
  <view class="u-countdown-time" :style="{ fontSize: props.fontSize + 'rpx', color: props.color }">
@@ -62,7 +62,7 @@
62
62
  :style="{ fontSize: props.separatorSize + 'rpx', color: props.separatorColor, paddingBottom: 0 }"
63
63
  v-if="props.showSeconds && props.separator == 'zh'"
64
64
  >
65
- {{ t('countDown.second') }}
65
+ {{ t('uCountDown.second') }}
66
66
  </view>
67
67
  </view>
68
68
  </template>
@@ -66,20 +66,20 @@ const props = defineProps(EmptyProps);
66
66
  */
67
67
  const icons = computed(() => {
68
68
  return {
69
- car: t('empty.car'),
70
- page: t('empty.page'),
71
- search: t('empty.search'),
72
- address: t('empty.address'),
73
- wifi: t('empty.wifi'),
74
- order: t('empty.order'),
75
- coupon: t('empty.coupon'),
76
- favor: t('empty.favor'),
77
- permission: t('empty.permission'),
78
- history: t('empty.history'),
79
- news: t('empty.news'),
80
- message: t('empty.message'),
81
- list: t('empty.list'),
82
- data: t('empty.data')
69
+ car: t('uEmpty.car'),
70
+ page: t('uEmpty.page'),
71
+ search: t('uEmpty.search'),
72
+ address: t('uEmpty.address'),
73
+ wifi: t('uEmpty.wifi'),
74
+ order: t('uEmpty.order'),
75
+ coupon: t('uEmpty.coupon'),
76
+ favor: t('uEmpty.favor'),
77
+ permission: t('uEmpty.permission'),
78
+ history: t('uEmpty.history'),
79
+ news: t('uEmpty.news'),
80
+ message: t('uEmpty.message'),
81
+ list: t('uEmpty.list'),
82
+ data: t('uEmpty.data')
83
83
  };
84
84
  });
85
85
  </script>
@@ -27,7 +27,7 @@
27
27
  }"
28
28
  >
29
29
  <!-- 为了块对齐 -->
30
- <view class="u-form-item--left__content" v-if="required || leftIcon || label">
30
+ <view class="u-form-item--left__content" v-if="required || leftIcon || label || $slots.label">
31
31
  <!-- nvue不支持伪元素before -->
32
32
  <text v-if="required" class="u-form-item--left__content--required">*</text>
33
33
  <view class="u-form-item--left__content__icon" v-if="leftIcon">
@@ -47,7 +47,9 @@
47
47
  }
48
48
  ]"
49
49
  >
50
- {{ label }}
50
+ <slot name="label">
51
+ {{ label }}
52
+ </slot>
51
53
  </view>
52
54
  </view>
53
55
  </view>
@@ -88,7 +90,7 @@ export default {
88
90
  </script>
89
91
 
90
92
  <script setup lang="ts">
91
- import { ref, computed, onMounted, onBeforeUnmount, watch, nextTick } from 'vue';
93
+ import { ref, computed, onMounted, onBeforeUnmount, watch, nextTick, useSlots } from 'vue';
92
94
  import { $u, useChildren, useParent } from '../..';
93
95
  // @ts-ignore
94
96
  import schema from '../../libs/util/async-validator';
@@ -119,6 +121,9 @@ const { broadcast } = useParent('u-form-item');
119
121
 
120
122
  const props = defineProps(FormItemProps);
121
123
 
124
+ // 插槽
125
+ const $slots = useSlots();
126
+
122
127
  const { parentExposed } = useChildren('u-form-item', 'u-form');
123
128
 
124
129
  // 组件状态
@@ -163,7 +168,7 @@ watch(
163
168
  const uLabelWidth = computed(() => {
164
169
  // 如果用户设置label为空字符串(微信小程序空字符串最终会变成字符串的'true'),意味着要将label的位置宽度设置为auto
165
170
  return elLabelPosition.value == 'left'
166
- ? props.label === 'true' || props.label === ''
171
+ ? (props.label === 'true' || props.label === '') && !$slots.label
167
172
  ? 'auto'
168
173
  : $u.addUnit(elLabelWidth.value)
169
174
  : '100%';
@@ -249,7 +254,9 @@ function getPropByPath(obj: any, path: string) {
249
254
  function getRules() {
250
255
  // 父组件的所有规则
251
256
  let rules = parentExposed?.value?.rules?.value || {};
252
- rules = rules ? rules[props.prop] || getPropByPath(rules,props.prop.replace(/(\.|^)(\d+)\./,'.defaultField.fields.')).v : [];
257
+ rules = rules
258
+ ? rules[props.prop] || getPropByPath(rules, props.prop.replace(/(\.|^)(\d+)\./, '.defaultField.fields.')).v
259
+ : [];
253
260
  // 保证返回的是一个数组形式
254
261
  return [].concat(rules || []);
255
262
  }
@@ -4,8 +4,8 @@
4
4
  :class="customClass"
5
5
  :style="$u.toStyle(customStyle)"
6
6
  :show-cancel-button="true"
7
- :confirm-text="t('fullScreen.upgrade')"
8
- :title="title || t('fullScreen.title')"
7
+ :confirm-text="t('uFullScreen.upgrade')"
8
+ :title="title || t('uFullScreen.title')"
9
9
  @cancel="cancel"
10
10
  @confirm="confirm"
11
11
  >
@@ -30,7 +30,7 @@ export const InputProps = {
30
30
  /** placeholder显示值(默认 '请输入内容') */
31
31
  placeholder: {
32
32
  type: String,
33
- default: () => t('input.placeholder')
33
+ default: () => t('uInput.placeholder')
34
34
  },
35
35
  /** 是否禁用输入框(默认false) */
36
36
  disabled: {
@@ -35,9 +35,9 @@ export const KeyboardProps = {
35
35
  /** z-index值 */
36
36
  zIndex: { type: [Number, String] as PropType<string | number>, default: '' },
37
37
  /** 取消按钮的文字 */
38
- cancelText: { type: String, default: () => t('keyboard.cancelText') },
38
+ cancelText: { type: String, default: () => t('uKeyboard.cancelText') },
39
39
  /** 确认按钮的文字 */
40
- confirmText: { type: String, default: () => t('keyboard.confirmText') }
40
+ confirmText: { type: String, default: () => t('uKeyboard.confirmText') }
41
41
  };
42
42
 
43
43
  export type KeyboardProps = ExtractPropTypes<typeof KeyboardProps>;
@@ -20,10 +20,10 @@
20
20
  tips
21
21
  ? tips
22
22
  : mode == 'number'
23
- ? t('keyboard.number')
23
+ ? t('uKeyboard.number')
24
24
  : mode == 'card'
25
- ? t('keyboard.idCard')
26
- : t('keyboard.plate')
25
+ ? t('uKeyboard.idCard')
26
+ : t('uKeyboard.plate')
27
27
  }}
28
28
  </view>
29
29
  <view
@@ -31,7 +31,7 @@ export const LinkProps = {
31
31
  /** 小程序中复制到粘贴板的提示语 */
32
32
  mpTips: {
33
33
  type: String,
34
- default: () => t('link.mpTips')
34
+ default: () => t('uLink.mpTips')
35
35
  },
36
36
  /** 下划线颜色 */
37
37
  lineColor: {
@@ -44,9 +44,9 @@ export const LoadmoreProps = {
44
44
  loadText: {
45
45
  type: Object as PropType<LoadmoreText>,
46
46
  default: () => ({
47
- loadmore: t('loadmore.loadmore'),
48
- loading: t('loadmore.loading'),
49
- nomore: t('loadmore.nomore')
47
+ loadmore: t('uLoadmore.loadmore'),
48
+ loading: t('uLoadmore.loading'),
49
+ nomore: t('uLoadmore.nomore')
50
50
  })
51
51
  },
52
52
  /** 在“没有更多”状态下,是否显示粗点 */
@@ -23,7 +23,7 @@ export const ModalProps = {
23
23
  /** 标题 */
24
24
  title: {
25
25
  type: String,
26
- default: () => t('modal.title')
26
+ default: () => t('uModal.title')
27
27
  },
28
28
  /** 弹窗宽度 */
29
29
  width: {
@@ -33,7 +33,7 @@ export const ModalProps = {
33
33
  /** 弹窗内容 */
34
34
  content: {
35
35
  type: String,
36
- default: () => t('modal.content')
36
+ default: () => t('uModal.content')
37
37
  },
38
38
  /** 是否显示标题 */
39
39
  showTitle: {
@@ -53,12 +53,12 @@ export const ModalProps = {
53
53
  /** 确认文案 */
54
54
  confirmText: {
55
55
  type: String,
56
- default: () => t('modal.confirmText')
56
+ default: () => t('uModal.confirmText')
57
57
  },
58
58
  /** 取消文案 */
59
59
  cancelText: {
60
60
  type: String,
61
- default: () => t('modal.cancelText')
61
+ default: () => t('uModal.cancelText')
62
62
  },
63
63
  /** 确认按钮颜色 */
64
64
  confirmColor: {
@@ -12,7 +12,7 @@ export const NoNetworkProps = {
12
12
  /** 页面文字提示 */
13
13
  tips: {
14
14
  type: String,
15
- default: () => t('noNetwork.tips')
15
+ default: () => t('uNoNetwork.tips')
16
16
  },
17
17
  /** 一个z-index值,用于设置没有网络这个组件的层次 */
18
18
  zIndex: {
@@ -8,14 +8,14 @@
8
8
  <!-- 只有APP平台,才能跳转设置页,因为需要调用plus环境 -->
9
9
  <!-- #ifdef APP-PLUS -->
10
10
  <view class="u-to-setting">
11
- {{ t('noNetwork.checkNetwork') }}
11
+ {{ t('uNoNetwork.checkNetwork') }}
12
12
  <text class="u-setting-btn" @tap="openSettings">
13
- {{ t('noNetwork.setting') }}
13
+ {{ t('uNoNetwork.setting') }}
14
14
  </text>
15
15
  </view>
16
16
  <!-- #endif -->
17
17
  <view class="u-retry" :hover-stay-time="150" @tap="retry" hover-class="u-retry-hover">
18
- {{ t('noNetwork.retry') }}
18
+ {{ t('uNoNetwork.retry') }}
19
19
  </view>
20
20
  </view>
21
21
  </view>
@@ -98,14 +98,14 @@ function retry() {
98
98
  networkType.value = res.networkType;
99
99
  if (res.networkType == 'none') {
100
100
  uni.showToast({
101
- title: t('noNetwork.noConnection'),
101
+ title: t('uNoNetwork.noConnection'),
102
102
  icon: 'none',
103
103
  position: 'top'
104
104
  });
105
105
  isConnected.value = false;
106
106
  } else {
107
107
  uni.showToast({
108
- title: t('noNetwork.connected'),
108
+ title: t('uNoNetwork.connected'),
109
109
  icon: 'none',
110
110
  position: 'top'
111
111
  });
@@ -12,9 +12,9 @@ const { t } = useLocale();
12
12
  export const PaginationProps = {
13
13
  ...baseProps,
14
14
  /** 左侧按钮文字 */
15
- prevText: { type: String, default: () => t('pagination.prevText') },
15
+ prevText: { type: String, default: () => t('uPagination.prevText') },
16
16
  /** 右侧按钮文字 */
17
- nextText: { type: String, default: () => t('pagination.nextText') },
17
+ nextText: { type: String, default: () => t('uPagination.nextText') },
18
18
  /** 总条目数 */
19
19
  total: Number,
20
20
  /** 每页数据量 */
@@ -122,12 +122,12 @@ export const PickerProps = {
122
122
  /** 取消按钮的文字 */
123
123
  cancelText: {
124
124
  type: String,
125
- default: () => t('picker.cancelText')
125
+ default: () => t('uPicker.cancelText')
126
126
  },
127
127
  /** 确认按钮的文字 */
128
128
  confirmText: {
129
129
  type: String,
130
- default: () => t('picker.confirmText')
130
+ default: () => t('uPicker.confirmText')
131
131
  }
132
132
  };
133
133
 
@@ -15,9 +15,9 @@ export const ReadMoreProps = {
15
15
  /** 展开后是否显示"收起"按钮 */
16
16
  toggle: { type: Boolean, default: false },
17
17
  /** 关闭时的提示文字 */
18
- closeText: { type: String, default: () => t('readMore.closeText') },
18
+ closeText: { type: String, default: () => t('uReadMore.closeText') },
19
19
  /** 展开时的提示文字 */
20
- openText: { type: String, default: () => t('readMore.openText') },
20
+ openText: { type: String, default: () => t('uReadMore.openText') },
21
21
  /** 提示的文字颜色 */
22
22
  color: { type: String, default: () => getColor('primary') },
23
23
  /** 提示文字的大小 */
@@ -16,7 +16,7 @@ export const SearchProps = {
16
16
  /** 搜索框背景色,默认值var(--u-bg-gray-light) */
17
17
  bgColor: { type: String, default: 'var(--u-bg-gray-light)' },
18
18
  /** 占位提示文字 */
19
- placeholder: { type: String, default: () => t('search.placeholder') },
19
+ placeholder: { type: String, default: () => t('uSearch.placeholder') },
20
20
  /** 是否启用清除控件 */
21
21
  clearabled: { type: Boolean, default: true },
22
22
  /** 是否自动聚焦 */
@@ -26,7 +26,7 @@ export const SearchProps = {
26
26
  /** 右边控件的样式 */
27
27
  actionStyle: { type: Object as PropType<Record<string, any>>, default: () => ({}) },
28
28
  /** 取消按钮文字 */
29
- actionText: { type: String, default: () => t('search.actionText') },
29
+ actionText: { type: String, default: () => t('uSearch.actionText') },
30
30
  /** 输入框内容对齐方式,可选值为 left|center|right */
31
31
  inputAlign: { type: String as PropType<InputAlign>, default: 'left' },
32
32
  /** 是否启用输入框 */
@@ -15,7 +15,7 @@ export const SectionProps = {
15
15
  /** 标题信息 */
16
16
  title: { type: String, default: '' },
17
17
  /** 右边副标题内容 */
18
- subTitle: { type: String, default: () => t('section.subTitle') },
18
+ subTitle: { type: String, default: () => t('uSection.subTitle') },
19
19
  /** 是否显示右边的内容 */
20
20
  right: { type: Boolean, default: true },
21
21
  /** 主标题的字体大小 */
@@ -42,9 +42,9 @@ export const SelectProps = {
42
42
  /** 顶部标题 */
43
43
  title: { type: String, default: '' },
44
44
  /** 取消按钮的文字 */
45
- cancelText: { type: String, default: () => t('select.cancelText') },
45
+ cancelText: { type: String, default: () => t('uSelect.cancelText') },
46
46
  /** 确认按钮的文字 */
47
- confirmText: { type: String, default: () => t('select.confirmText') }
47
+ confirmText: { type: String, default: () => t('uSelect.confirmText') }
48
48
  };
49
49
 
50
50
  export type SelectProps = ExtractPropTypes<typeof SelectProps>;
@@ -34,7 +34,7 @@ export const UploadProps = {
34
34
  /** 是否自定义上传按钮 */
35
35
  customBtn: { type: Boolean, default: false },
36
36
  /** 上传按钮文字 */
37
- uploadText: { type: String, default: () => t('upload.uploadText') },
37
+ uploadText: { type: String, default: () => t('uUpload.uploadText') },
38
38
  /** 上传地址 */
39
39
  action: { type: String, default: '' },
40
40
  /** 是否禁用 */
@@ -205,11 +205,11 @@ function selectFile() {
205
205
  if (!props.multiple && index >= 1) return;
206
206
  if (val.size > Number(props.maxSize)) {
207
207
  emit('on-oversize', val, lists.value, props.index);
208
- showToast(t('upload.overSize'));
208
+ showToast(t('uUpload.overSize'));
209
209
  } else {
210
210
  if (Number(props.maxCount) <= lists.value.length) {
211
211
  emit('on-exceed', val, lists.value, props.index);
212
- showToast(t('upload.overMaxCount'));
212
+ showToast(t('uUpload.overMaxCount'));
213
213
  return;
214
214
  }
215
215
  lists.value.push({ url: val.path, progress: 0, error: false, file: val });
@@ -248,7 +248,7 @@ function retry(index: number) {
248
248
  lists.value[index].error = false;
249
249
  lists.value[index].response = null;
250
250
  if (props.showTips) {
251
- uni.showLoading({ title: t('upload.reUpload') });
251
+ uni.showLoading({ title: t('uUpload.reUpload') });
252
252
  }
253
253
  uploadFile(index);
254
254
  }
@@ -301,7 +301,7 @@ async function uploadFile(index = 0) {
301
301
  }
302
302
  // 检查上传地址
303
303
  if (!props.action) {
304
- showToast(t('upload.noAction'), true);
304
+ showToast(t('uUpload.noAction'), true);
305
305
  return;
306
306
  }
307
307
  lists.value[index].error = false;
@@ -355,7 +355,7 @@ function uploadError(index: number, err: any) {
355
355
  lists.value[index].error = true;
356
356
  lists.value[index].response = null;
357
357
  emit('on-error', err, index, lists.value, props.index);
358
- showToast(t('upload.uploadFailed'));
358
+ showToast(t('uUpload.uploadFailed'));
359
359
  }
360
360
 
361
361
  /**
@@ -363,8 +363,8 @@ function uploadError(index: number, err: any) {
363
363
  */
364
364
  function deleteItem(index: number) {
365
365
  uni.showModal({
366
- title: t('upload.modalTitle'),
367
- content: t('upload.deleteConfirm'),
366
+ title: t('uUpload.modalTitle'),
367
+ content: t('uUpload.deleteConfirm'),
368
368
  success: async (res: any) => {
369
369
  if (res.confirm) {
370
370
  // 先检查是否有定义before-remove移除前钩子
@@ -385,11 +385,11 @@ function deleteItem(index: number) {
385
385
  })
386
386
  .catch(() => {
387
387
  // 如果进入promise的reject,终止删除操作
388
- showToast(t('upload.terminatedRemove'));
388
+ showToast(t('uUpload.terminatedRemove'));
389
389
  });
390
390
  } else if (beforeResponse === false) {
391
391
  // 返回false,终止删除
392
- showToast(t('upload.terminatedRemove'));
392
+ showToast(t('uUpload.terminatedRemove'));
393
393
  } else {
394
394
  // 如果返回true,执行删除操作
395
395
  handlerDeleteItem(index);
@@ -413,7 +413,7 @@ function handlerDeleteItem(index: number) {
413
413
  }
414
414
  lists.value.splice(index, 1);
415
415
  emit('on-remove', index, lists.value, props.index);
416
- showToast(t('upload.removeSuccess'));
416
+ showToast(t('uUpload.removeSuccess'));
417
417
  }
418
418
 
419
419
  /**
@@ -442,7 +442,7 @@ function doPreviewImage(url: string, index: number) {
442
442
  emit('on-preview', url, lists.value, props.index);
443
443
  },
444
444
  fail: () => {
445
- uni.showToast({ title: t('upload.previewFailed'), icon: 'none' });
445
+ uni.showToast({ title: t('uUpload.previewFailed'), icon: 'none' });
446
446
  }
447
447
  });
448
448
  }
@@ -471,7 +471,7 @@ function checkFileExt(file: any) {
471
471
  // 转为小写
472
472
  return ext.toLowerCase() === fileExt;
473
473
  });
474
- if (!noArrowExt) showToast(t('upload.notAllowedExt', { ext: fileExt }));
474
+ if (!noArrowExt) showToast(t('uUpload.notAllowedExt', { ext: fileExt }));
475
475
  return noArrowExt;
476
476
  }
477
477
 
@@ -13,11 +13,11 @@ export const VerificationCodeProps = {
13
13
  /** 倒计时时长,单位秒 */
14
14
  seconds: { type: [String, Number] as PropType<string | number>, default: 60 },
15
15
  /** 开始时按钮文字 */
16
- startText: { type: String, default: () => t('verificationCode.startText') },
16
+ startText: { type: String, default: () => t('uVerificationCode.startText') },
17
17
  /** 倒计时进行中按钮文字,X为剩余秒数 */
18
- changeText: { type: String, default: () => t('verificationCode.changeText') },
18
+ changeText: { type: String, default: () => t('uVerificationCode.changeText') },
19
19
  /** 结束时按钮文字 */
20
- endText: { type: String, default: () => t('verificationCode.endText') },
20
+ endText: { type: String, default: () => t('uVerificationCode.endText') },
21
21
  /** 是否保持倒计时不中断(如页面切换) */
22
22
  keepRunning: { type: Boolean, default: false },
23
23
  /** 唯一标识key,用于区分多个验证码组件 */
@@ -1,9 +1,9 @@
1
1
  export default {
2
2
  name: 'en-US',
3
- actionSheet: {
3
+ uActionSheet: {
4
4
  cancelText: 'Cancel'
5
5
  },
6
- upload: {
6
+ uUpload: {
7
7
  uploadText: 'Select Image',
8
8
  retry: 'Retry',
9
9
  overSize: 'File size exceeds allowed limit',
@@ -18,23 +18,23 @@ export default {
18
18
  notAllowedExt: 'Files with {ext} format are not allowed',
19
19
  noAction: 'Please configure upload address'
20
20
  },
21
- verificationCode: {
21
+ uVerificationCode: {
22
22
  startText: 'Get Code',
23
23
  changeText: 'Retry in Xs',
24
24
  endText: 'Retry'
25
25
  },
26
- section: {
26
+ uSection: {
27
27
  subTitle: 'More'
28
28
  },
29
- select: {
29
+ uSelect: {
30
30
  cancelText: 'Cancel',
31
31
  confirmText: 'Confirm'
32
32
  },
33
- search: {
33
+ uSearch: {
34
34
  placeholder: 'Please enter keywords',
35
35
  actionText: 'Search'
36
36
  },
37
- noNetwork: {
37
+ uNoNetwork: {
38
38
  tips: 'Ooops, network disconnected',
39
39
  checkNetwork: 'Please check network or go to',
40
40
  setting: 'Settings',
@@ -42,43 +42,43 @@ export default {
42
42
  noConnection: 'No network connection',
43
43
  connected: 'Network connected'
44
44
  },
45
- readMore: {
45
+ uReadMore: {
46
46
  closeText: 'Read More',
47
47
  openText: 'Collapse'
48
48
  },
49
- pagination: {
49
+ uPagination: {
50
50
  prevText: 'Prev',
51
51
  nextText: 'Next'
52
52
  },
53
- picker: {
53
+ uPicker: {
54
54
  cancelText: 'Cancel',
55
55
  confirmText: 'Confirm'
56
56
  },
57
- modal: {
57
+ uModal: {
58
58
  title: 'Notice',
59
59
  content: 'Content',
60
60
  confirmText: 'Confirm',
61
61
  cancelText: 'Cancel'
62
62
  },
63
- loadmore: {
63
+ uLoadmore: {
64
64
  loadmore: 'Load more',
65
65
  loading: 'Loading...',
66
66
  nomore: 'No more'
67
67
  },
68
- link: {
68
+ uLink: {
69
69
  mpTips: 'Link copied, please open it in browser'
70
70
  },
71
- keyboard: {
71
+ uKeyboard: {
72
72
  cancelText: 'Cancel',
73
73
  confirmText: 'Confirm',
74
74
  number: 'Number Keyboard',
75
75
  idCard: 'ID Card Keyboard',
76
76
  plate: 'Plate Keyboard'
77
77
  },
78
- input: {
78
+ uInput: {
79
79
  placeholder: 'Please enter'
80
80
  },
81
- calendar: {
81
+ uCalendar: {
82
82
  startText: 'Start',
83
83
  endText: 'End',
84
84
  toolTip: 'Select date',
@@ -95,7 +95,7 @@ export default {
95
95
  confirmText: 'Confirm',
96
96
  to: ' to '
97
97
  },
98
- empty: {
98
+ uEmpty: {
99
99
  car: 'Shopping cart is empty',
100
100
  page: 'Page not found',
101
101
  search: 'No search results',
@@ -111,13 +111,13 @@ export default {
111
111
  list: 'No list',
112
112
  data: 'No data'
113
113
  },
114
- countDown: {
114
+ uCountDown: {
115
115
  day: 'days',
116
116
  hour: 'hours',
117
117
  minute: 'minutes',
118
118
  second: 'Second'
119
119
  },
120
- fullScreen: {
120
+ uFullScreen: {
121
121
  title: 'New Version Available',
122
122
  upgrade: 'Upgrade'
123
123
  }
@@ -1,9 +1,9 @@
1
1
  export default {
2
2
  name: 'zh-CN',
3
- actionSheet: {
3
+ uActionSheet: {
4
4
  cancelText: '取消'
5
5
  },
6
- upload: {
6
+ uUpload: {
7
7
  uploadText: '选择图片',
8
8
  retry: '点击重试',
9
9
  overSize: '超出允许的文件大小',
@@ -18,23 +18,23 @@ export default {
18
18
  notAllowedExt: '不允许选择{ext}格式的文件',
19
19
  noAction: '请配置上传地址'
20
20
  },
21
- verificationCode: {
21
+ uVerificationCode: {
22
22
  startText: '获取验证码',
23
23
  changeText: 'X秒重新获取',
24
24
  endText: '重新获取'
25
25
  },
26
- section: {
26
+ uSection: {
27
27
  subTitle: '更多'
28
28
  },
29
- select: {
29
+ uSelect: {
30
30
  cancelText: '取消',
31
31
  confirmText: '确认'
32
32
  },
33
- search: {
33
+ uSearch: {
34
34
  placeholder: '请输入关键字',
35
35
  actionText: '搜索'
36
36
  },
37
- noNetwork: {
37
+ uNoNetwork: {
38
38
  tips: '哎呀,网络信号丢失',
39
39
  checkNetwork: '请检查网络,或前往',
40
40
  setting: '设置',
@@ -42,43 +42,43 @@ export default {
42
42
  noConnection: '无网络连接',
43
43
  connected: '网络已连接'
44
44
  },
45
- readMore: {
45
+ uReadMore: {
46
46
  closeText: '展开阅读全文',
47
47
  openText: '收起'
48
48
  },
49
- pagination: {
49
+ uPagination: {
50
50
  prevText: '上一页',
51
51
  nextText: '下一页'
52
52
  },
53
- picker: {
53
+ uPicker: {
54
54
  cancelText: '取消',
55
55
  confirmText: '确认'
56
56
  },
57
- modal: {
57
+ uModal: {
58
58
  title: '提示',
59
59
  content: '内容',
60
60
  confirmText: '确认',
61
61
  cancelText: '取消'
62
62
  },
63
- loadmore: {
63
+ uLoadmore: {
64
64
  loadmore: '加载更多',
65
65
  loading: '正在加载...',
66
66
  nomore: '没有更多了'
67
67
  },
68
- link: {
68
+ uLink: {
69
69
  mpTips: '链接已复制,请在浏览器打开'
70
70
  },
71
- keyboard: {
71
+ uKeyboard: {
72
72
  cancelText: '取消',
73
73
  confirmText: '确认',
74
74
  number: '数字键盘',
75
75
  idCard: '身份证键盘',
76
76
  plate: '车牌号键盘'
77
77
  },
78
- input: {
78
+ uInput: {
79
79
  placeholder: '请输入内容'
80
80
  },
81
- calendar: {
81
+ uCalendar: {
82
82
  startText: '开始',
83
83
  endText: '结束',
84
84
  toolTip: '选择日期',
@@ -95,7 +95,7 @@ export default {
95
95
  confirmText: '确定',
96
96
  to: '至'
97
97
  },
98
- empty: {
98
+ uEmpty: {
99
99
  car: '购物车为空',
100
100
  page: '页面不存在',
101
101
  search: '没有搜索结果',
@@ -111,13 +111,13 @@ export default {
111
111
  list: '列表为空',
112
112
  data: '数据为空'
113
113
  },
114
- countDown: {
114
+ uCountDown: {
115
115
  day: '天',
116
116
  hour: '时',
117
117
  minute: '分',
118
118
  second: '秒'
119
119
  },
120
- fullScreen: {
120
+ uFullScreen: {
121
121
  title: '发现新版本',
122
122
  upgrade: '升级'
123
123
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "id": "uview-pro",
3
3
  "name": "uview-pro",
4
- "displayName": "【支持鸿蒙】uView Pro|基于Vue3+TS的高质量UI组件库,支持多主题、暗黑模式",
5
- "version": "0.5.0",
6
- "description": "uView Pro是基于Vue3+TS的多平台UI框架,提供80+高质量组件、便捷工具和常用模板,支持多主题与暗黑模式,支持H5/APP/鸿蒙/小程序等多端开发。已在华为鸿蒙应用商店上架,欢迎体验!",
4
+ "displayName": "【支持鸿蒙】uView Pro|基于Vue3+TS的高质量UI组件库,支持多主题、暗黑模式、多语言",
5
+ "version": "0.5.1",
6
+ "description": "uView Pro是基于Vue3+TS的多平台UI框架,提供80+高质量组件、便捷工具和常用模板,支持多主题、暗黑模式、多语言,支持H5/APP/鸿蒙/小程序多端开发。已在鸿蒙应用商店上架,欢迎体验!",
7
7
  "main": "index.ts",
8
8
  "module": "index.ts",
9
9
  "browser": "index.ts",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "npmurl": "https://www.npmjs.com/package/uview-pro",
44
44
  "darkmode": "√",
45
- "i18n": "x",
45
+ "i18n": "",
46
46
  "widescreen": "√"
47
47
  },
48
48
  "uni_modules": {