Skip to content

Commit 08f0f59

Browse files
authored
Merge branch 'main' into fix-6273
2 parents d52bd8d + b8bf482 commit 08f0f59

File tree

100 files changed

+5747
-3938
lines changed

Some content is hidden

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

100 files changed

+5747
-3938
lines changed

.github/contributing.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ Project maintainers have the right and responsibility to remove, edit, or reject
1919
- Checkout a topic branch from the relevant branch, e.g. main, and merge back against that branch.
2020

2121
- If adding a new feature:
22-
2322
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
2423

2524
- If fixing bug:
26-
2725
- Provide a detailed description of the bug in the PR. Live demo preferred.
2826

2927
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.

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/component/index.ts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ import type { Component } from 'vue';
88
import type { BaseFormComponentType } from '@vben/common-ui';
99
import type { Recordable } from '@vben/types';
1010

11-
import {
12-
defineAsyncComponent,
13-
defineComponent,
14-
getCurrentInstance,
15-
h,
16-
ref,
17-
} from 'vue';
11+
import { defineAsyncComponent, defineComponent, h, ref } from 'vue';
1812

1913
import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui';
2014
import { $t } from '@vben/locales';
@@ -82,16 +76,15 @@ const withDefaultPlaceholder = <T extends Component>(
8276
$t(`ui.placeholder.${type}`);
8377
// 透传组件暴露的方法
8478
const innerRef = ref();
85-
const publicApi: Recordable<any> = {};
86-
expose(publicApi);
87-
const instance = getCurrentInstance();
88-
instance?.proxy?.$nextTick(() => {
89-
for (const key in innerRef.value) {
90-
if (typeof innerRef.value[key] === 'function') {
91-
publicApi[key] = innerRef.value[key];
92-
}
93-
}
94-
});
79+
expose(
80+
new Proxy(
81+
{},
82+
{
83+
get: (_target, key) => innerRef.value?.[key],
84+
has: (_target, key) => key in (innerRef.value || {}),
85+
},
86+
),
87+
);
9588
return () =>
9689
h(
9790
component,

apps/web-antd/src/adapter/vxe-table.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
2+
13
import { h } from 'vue';
24

35
import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
@@ -33,7 +35,7 @@ setupVbenVxeTable({
3335
round: true,
3436
showOverflow: true,
3537
size: 'small',
36-
},
38+
} as VxeTableGridOptions,
3739
});
3840

3941
// 表格配置项可以用 cellRender: { name: 'CellImage' },

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/component/index.ts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ import type { Component } from 'vue';
88
import type { BaseFormComponentType } from '@vben/common-ui';
99
import type { Recordable } from '@vben/types';
1010

11-
import {
12-
defineAsyncComponent,
13-
defineComponent,
14-
getCurrentInstance,
15-
h,
16-
ref,
17-
} from 'vue';
11+
import { defineAsyncComponent, defineComponent, h, ref } from 'vue';
1812

1913
import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui';
2014
import { $t } from '@vben/locales';
@@ -139,16 +133,15 @@ const withDefaultPlaceholder = <T extends Component>(
139133
$t(`ui.placeholder.${type}`);
140134
// 透传组件暴露的方法
141135
const innerRef = ref();
142-
const publicApi: Recordable<any> = {};
143-
expose(publicApi);
144-
const instance = getCurrentInstance();
145-
instance?.proxy?.$nextTick(() => {
146-
for (const key in innerRef.value) {
147-
if (typeof innerRef.value[key] === 'function') {
148-
publicApi[key] = innerRef.value[key];
149-
}
150-
}
151-
});
136+
expose(
137+
new Proxy(
138+
{},
139+
{
140+
get: (_target, key) => innerRef.value?.[key],
141+
has: (_target, key) => key in (innerRef.value || {}),
142+
},
143+
),
144+
);
152145
return () =>
153146
h(
154147
component,

apps/web-ele/src/adapter/vxe-table.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
2+
13
import { h } from 'vue';
24

35
import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
@@ -33,7 +35,7 @@ setupVbenVxeTable({
3335
round: true,
3436
showOverflow: true,
3537
size: 'small',
36-
},
38+
} as VxeTableGridOptions,
3739
});
3840

3941
// 表格配置项可以用 cellRender: { name: 'CellImage' },

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/component/index.ts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ import type { Component } from 'vue';
88
import type { BaseFormComponentType } from '@vben/common-ui';
99
import type { Recordable } from '@vben/types';
1010

11-
import {
12-
defineAsyncComponent,
13-
defineComponent,
14-
getCurrentInstance,
15-
h,
16-
ref,
17-
} from 'vue';
11+
import { defineAsyncComponent, defineComponent, h, ref } from 'vue';
1812

1913
import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui';
2014
import { $t } from '@vben/locales';
@@ -85,16 +79,15 @@ const withDefaultPlaceholder = <T extends Component>(
8579
$t(`ui.placeholder.${type}`);
8680
// 透传组件暴露的方法
8781
const innerRef = ref();
88-
const publicApi: Recordable<any> = {};
89-
expose(publicApi);
90-
const instance = getCurrentInstance();
91-
instance?.proxy?.$nextTick(() => {
92-
for (const key in innerRef.value) {
93-
if (typeof innerRef.value[key] === 'function') {
94-
publicApi[key] = innerRef.value[key];
95-
}
96-
}
97-
});
82+
expose(
83+
new Proxy(
84+
{},
85+
{
86+
get: (_target, key) => innerRef.value?.[key],
87+
has: (_target, key) => key in (innerRef.value || {}),
88+
},
89+
),
90+
);
9891
return () =>
9992
h(
10093
component,

apps/web-naive/src/adapter/vxe-table.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
2+
13
import { h } from 'vue';
24

35
import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
@@ -33,7 +35,7 @@ setupVbenVxeTable({
3335
round: true,
3436
showOverflow: true,
3537
size: 'small',
36-
},
38+
} as VxeTableGridOptions,
3739
});
3840

3941
// 表格配置项可以用 cellRender: { name: 'CellImage' },

0 commit comments

Comments
 (0)