This commit is contained in:
神仙都没用 2025-02-19 10:07:34 +08:00
parent 6412330d2e
commit 719fb21fda
2 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@cool-vue/crud", "name": "@cool-vue/crud",
"version": "7.2.12", "version": "7.2.13",
"private": false, "private": false,
"main": "./dist/index.umd.min.js", "main": "./dist/index.umd.min.js",
"typings": "types/index.d.ts", "typings": "types/index.d.ts",

View File

@ -60,10 +60,15 @@ export function useProxy(ctx: any) {
} }
export function useElApi(keys: string[], el: any) { export function useElApi(keys: string[], el: any) {
return keys.reduce((apis, key) => { const apis: obj = {};
apis[key] = computed(() => el.value?.[key]);
return apis; keys.forEach((e) => {
}, {} as obj); apis[e] = (...args: any[]) => {
return el.value[e](...args);
};
});
return apis;
} }
export * from "./crud"; export * from "./crud";