Skip to content

Commit 4d97b01

Browse files
committed
* 'main' of https://github.com/baohaojie123/vue-vben-admin: (35 commits) chore: release 5.5.7 feat: improve vbenCheckButtonGroup (vbenjs#6329) types: 扩展user-dropdown组件的menus类型,支持iconify (vbenjs#6283) fix: resolve onClosed method failure in connectedComponent of useVbenModal (vbenjs#6309) fix: 修复使用useVbenVxeGrid配置hasEmptyText、hasEmptyRender不生效的问题 (vbenjs#6310) fix: When defaultHomePage is inconsistent with user.homePath, the pa… (vbenjs#6299) docs(settings): 完善'生产环境动态配置'步骤 (vbenjs#6297) fix: alert width fixed in small screen (vbenjs#6312) style: fix lint error (vbenjs#6298) feat: support for hybrid permission access control mode (vbenjs#6294) fix: fix table-title slot not work (vbenjs#6295) fix: Update index.ts (vbenjs#6268) fix: reset slider-captcha after login failed (vbenjs#6275) fix: json-bigint parse used in vxeTable (vbenjs#6271) fix: repair the unexpected form default value (vbenjs#5567) feat: optimize logo display (vbenjs#6267) feat: improve check updates (vbenjs#6257) feat: enhances compatibility with APIs returning large numeric values (vbenjs#6250) fix: component Input is not registered when initialize page (vbenjs#6246) feat: ellipsis text automatically displays tooltip based on ellipsis (vbenjs#6244) ... # Conflicts: # apps/web-naive/src/adapter/form.ts # apps/web-naive/src/bootstrap.ts # docs/src/components/common-ui/vben-ellipsis-text.md # docs/src/en/guide/in-depth/access.md # docs/src/guide/essentials/build.md # docs/src/guide/essentials/route.md
2 parents c1a28f2 + b9aef61 commit 4d97b01

File tree

99 files changed

+2529
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2529
-302
lines changed

apps/backend-mock/api/demo/bigint.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export default eventHandler(async (event) => {
2+
const userinfo = verifyAccessToken(event);
3+
if (!userinfo) {
4+
return unAuthorizedResponse(event);
5+
}
6+
const data = `
7+
{
8+
"code": 0,
9+
"message": "success",
10+
"data": [
11+
{
12+
"id": 123456789012345678901234567890123456789012345678901234567890,
13+
"name": "John Doe",
14+
"age": 30,
15+
"email": "[email protected]"
16+
},
17+
{
18+
"id": 987654321098765432109876543210987654321098765432109876543210,
19+
"name": "Jane Smith",
20+
"age": 25,
21+
"email": "[email protected]"
22+
}
23+
]
24+
}
25+
`;
26+
setHeader(event, 'Content-Type', 'application/json');
27+
return data;
28+
});

apps/web-antd/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vben/web-antd",
3-
"version": "5.5.6",
3+
"version": "5.5.7",
44
"homepage": "https://vben.pro",
55
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
66
"repository": {

apps/web-antd/src/adapter/form.ts

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,42 @@ import type { ComponentType } from './component';
88
import { setupVbenForm, useVbenForm as useForm, z } from '@vben/common-ui';
99
import { $t } from '@vben/locales';
1010

11-
setupVbenForm<ComponentType>({
12-
config: {
13-
// ant design vue组件库默认都是 v-model:value
14-
baseModelPropName: 'value',
11+
async function initSetupVbenForm() {
12+
setupVbenForm<ComponentType>({
13+
config: {
14+
// ant design vue组件库默认都是 v-model:value
15+
baseModelPropName: 'value',
1516

16-
// 一些组件是 v-model:checked 或者 v-model:fileList
17-
modelPropNameMap: {
18-
Checkbox: 'checked',
19-
Radio: 'checked',
20-
Switch: 'checked',
21-
Upload: 'fileList',
17+
// 一些组件是 v-model:checked 或者 v-model:fileList
18+
modelPropNameMap: {
19+
Checkbox: 'checked',
20+
Radio: 'checked',
21+
Switch: 'checked',
22+
Upload: 'fileList',
23+
},
2224
},
23-
},
24-
defineRules: {
25-
// 输入项目必填国际化适配
26-
required: (value, _params, ctx) => {
27-
if (value === undefined || value === null || value.length === 0) {
28-
return $t('ui.formRules.required', [ctx.label]);
29-
}
30-
return true;
25+
defineRules: {
26+
// 输入项目必填国际化适配
27+
required: (value, _params, ctx) => {
28+
if (value === undefined || value === null || value.length === 0) {
29+
return $t('ui.formRules.required', [ctx.label]);
30+
}
31+
return true;
32+
},
33+
// 选择项目必填国际化适配
34+
selectRequired: (value, _params, ctx) => {
35+
if (value === undefined || value === null) {
36+
return $t('ui.formRules.selectRequired', [ctx.label]);
37+
}
38+
return true;
39+
},
3140
},
32-
// 选择项目必填国际化适配
33-
selectRequired: (value, _params, ctx) => {
34-
if (value === undefined || value === null) {
35-
return $t('ui.formRules.selectRequired', [ctx.label]);
36-
}
37-
return true;
38-
},
39-
},
40-
});
41+
});
42+
}
4143

4244
const useVbenForm = useForm<ComponentType>;
4345

44-
export { useVbenForm, z };
46+
export { initSetupVbenForm, useVbenForm, z };
4547

4648
export type VbenFormSchema = FormSchema<ComponentType>;
4749
export type { VbenFormProps };

apps/web-antd/src/bootstrap.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ import { useTitle } from '@vueuse/core';
1212
import { $t, setupI18n } from '#/locales';
1313

1414
import { initComponentAdapter } from './adapter/component';
15+
import { initSetupVbenForm } from './adapter/form';
1516
import App from './app.vue';
1617
import { router } from './router';
1718

1819
async function bootstrap(namespace: string) {
1920
// 初始化组件适配器
2021
await initComponentAdapter();
2122

23+
// 初始化表单组件
24+
await initSetupVbenForm();
25+
2226
// // 设置弹窗的默认配置
2327
// setDefaultModalProps({
2428
// fullscreenButton: false,

apps/web-ele/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vben/web-ele",
3-
"version": "5.5.6",
3+
"version": "5.5.7",
44
"homepage": "https://vben.pro",
55
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
66
"repository": {

apps/web-ele/src/adapter/form.ts

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,34 @@ import type { ComponentType } from './component';
88
import { setupVbenForm, useVbenForm as useForm, z } from '@vben/common-ui';
99
import { $t } from '@vben/locales';
1010

11-
setupVbenForm<ComponentType>({
12-
config: {
13-
modelPropNameMap: {
14-
Upload: 'fileList',
15-
CheckboxGroup: 'model-value',
11+
async function initSetupVbenForm() {
12+
setupVbenForm<ComponentType>({
13+
config: {
14+
modelPropNameMap: {
15+
Upload: 'fileList',
16+
CheckboxGroup: 'model-value',
17+
},
1618
},
17-
},
18-
defineRules: {
19-
required: (value, _params, ctx) => {
20-
if (value === undefined || value === null || value.length === 0) {
21-
return $t('ui.formRules.required', [ctx.label]);
22-
}
23-
return true;
19+
defineRules: {
20+
required: (value, _params, ctx) => {
21+
if (value === undefined || value === null || value.length === 0) {
22+
return $t('ui.formRules.required', [ctx.label]);
23+
}
24+
return true;
25+
},
26+
selectRequired: (value, _params, ctx) => {
27+
if (value === undefined || value === null) {
28+
return $t('ui.formRules.selectRequired', [ctx.label]);
29+
}
30+
return true;
31+
},
2432
},
25-
selectRequired: (value, _params, ctx) => {
26-
if (value === undefined || value === null) {
27-
return $t('ui.formRules.selectRequired', [ctx.label]);
28-
}
29-
return true;
30-
},
31-
},
32-
});
33+
});
34+
}
3335

3436
const useVbenForm = useForm<ComponentType>;
3537

36-
export { useVbenForm, z };
38+
export { initSetupVbenForm, useVbenForm, z };
3739

3840
export type VbenFormSchema = FormSchema<ComponentType>;
3941
export type { VbenFormProps };

apps/web-ele/src/bootstrap.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ import { ElLoading } from 'element-plus';
1313
import { $t, setupI18n } from '#/locales';
1414

1515
import { initComponentAdapter } from './adapter/component';
16+
import { initSetupVbenForm } from './adapter/form';
1617
import App from './app.vue';
1718
import { router } from './router';
1819

1920
async function bootstrap(namespace: string) {
2021
// 初始化组件适配器
2122
await initComponentAdapter();
23+
24+
// 初始化表单组件
25+
await initSetupVbenForm();
26+
2227
// // 设置弹窗的默认配置
2328
// setDefaultModalProps({
2429
// fullscreenButton: false,

apps/web-naive/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vben/web-naive",
3-
"version": "5.5.6",
3+
"version": "5.5.7",
44
"homepage": "https://vben.pro",
55
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
66
"repository": {

apps/web-naive/src/adapter/form.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import type {
2+
VbenFormSchema as FormSchema,
3+
VbenFormProps,
4+
} from '@vben/common-ui';
5+
6+
import type { ComponentType } from './component';
7+
8+
import { setupVbenForm, useVbenForm as useForm, z } from '@vben/common-ui';
9+
import { $t } from '@vben/locales';
10+
11+
async function initSetupVbenForm() {
12+
setupVbenForm<ComponentType>({
13+
config: {
14+
// naive-ui组件的空值为null,不能是undefined,否则重置表单时不生效
15+
emptyStateValue: null,
16+
baseModelPropName: 'value',
17+
modelPropNameMap: {
18+
Checkbox: 'checked',
19+
Radio: 'checked',
20+
Upload: 'fileList',
21+
},
22+
},
23+
defineRules: {
24+
required: (value, _params, ctx) => {
25+
if (value === undefined || value === null || value.length === 0) {
26+
return $t('ui.formRules.required', [ctx.label]);
27+
}
28+
return true;
29+
},
30+
selectRequired: (value, _params, ctx) => {
31+
if (value === undefined || value === null) {
32+
return $t('ui.formRules.selectRequired', [ctx.label]);
33+
}
34+
return true;
35+
},
36+
},
37+
});
38+
}
39+
40+
const useVbenForm = useForm<ComponentType>;
41+
42+
export { initSetupVbenForm, useVbenForm, z };
43+
44+
export type VbenFormSchema = FormSchema<ComponentType>;
45+
export type { VbenFormProps };

apps/web-naive/src/bootstrap.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import { createApp, watchEffect } from 'vue';
2+
3+
import { registerAccessDirective } from '@vben/access';
4+
import { registerLoadingDirective } from '@vben/common-ui';
5+
import { preferences } from '@vben/preferences';
6+
import { initStores } from '@vben/stores';
7+
import '@vben/styles';
8+
import '@vben/styles/naive';
9+
10+
import { useTitle } from '@vueuse/core';
11+
12+
import { $t, setupI18n } from '#/locales';
13+
14+
import { initComponentAdapter } from './adapter/component';
15+
import { initSetupVbenForm } from './adapter/form';
16+
import App from './app.vue';
17+
import { router } from './router';
18+
19+
async function bootstrap(namespace: string) {
20+
// 初始化组件适配器
21+
await initComponentAdapter();
22+
23+
// 初始化表单组件
24+
await initSetupVbenForm();
25+
26+
// // 设置弹窗的默认配置
27+
// setDefaultModalProps({
28+
// fullscreenButton: false,
29+
// });
30+
// // 设置抽屉的默认配置
31+
// setDefaultDrawerProps({
32+
// // zIndex: 2000,
33+
// });
34+
35+
const app = createApp(App);
36+
37+
// 注册v-loading指令
38+
registerLoadingDirective(app, {
39+
loading: 'loading', // 在这里可以自定义指令名称,也可以明确提供false表示不注册这个指令
40+
spinning: 'spinning',
41+
});
42+
43+
// 国际化 i18n 配置
44+
await setupI18n(app);
45+
46+
// 配置 pinia-tore
47+
await initStores(app, { namespace });
48+
49+
// 安装权限指令
50+
registerAccessDirective(app);
51+
52+
// 初始化 tippy
53+
const { initTippy } = await import('@vben/common-ui/es/tippy');
54+
initTippy(app);
55+
56+
// 配置路由及路由守卫
57+
app.use(router);
58+
59+
// 配置Motion插件
60+
const { MotionPlugin } = await import('@vben/plugins/motion');
61+
app.use(MotionPlugin);
62+
63+
// 动态更新标题
64+
watchEffect(() => {
65+
if (preferences.app.dynamicTitle) {
66+
const routeTitle = router.currentRoute.value.meta?.title;
67+
const pageTitle =
68+
(routeTitle ? `${$t(routeTitle)} - ` : '') + preferences.app.name;
69+
useTitle(pageTitle);
70+
}
71+
});
72+
73+
app.mount('#app');
74+
}
75+
76+
export { bootstrap };

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vben/docs",
3-
"version": "5.5.6",
3+
"version": "5.5.7",
44
"private": true,
55
"scripts": {
66
"build": "vitepress build",

0 commit comments

Comments
 (0)