cosey 0.4.13 → 0.4.15

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.
@@ -3,8 +3,8 @@ export interface UseUpsertExposeOptions {
3
3
  success?: () => any;
4
4
  }
5
5
  export interface UseUpsertExpose<Row extends Record<string, any>, Data = any> {
6
- edit: (row: Row) => any;
7
- add: () => any;
6
+ edit: (row: Row, ...args: any[]) => any;
7
+ add: (...args: any[]) => any;
8
8
  setData: (data: Data) => UseUpsertExpose<Row, Data>;
9
9
  setOptions: (options: UseUpsertExposeOptions) => any;
10
10
  }
@@ -48,8 +48,8 @@ export interface UseExternalUpsertOptions {
48
48
  success?: () => any;
49
49
  }
50
50
  export interface UseExternalUpsertReturn<Row extends Record<string, any>, Data> {
51
- add: () => void;
52
- edit: (row: Row) => void;
51
+ add: (...args: any[]) => void;
52
+ edit: (...args: any[]) => void;
53
53
  setData: (data: Data) => void;
54
54
  expose: Readonly<ShallowRef<UseUpsertExpose<Row, Data> | null>>;
55
55
  ref: string;
@@ -114,11 +114,11 @@ function useUpsert(options) {
114
114
  function useOuterUpsert(options) {
115
115
  const refKey = uuid();
116
116
  const expose = useTemplateRef(refKey);
117
- const add = () => {
118
- expose.value?.add();
117
+ const add = (...args) => {
118
+ expose.value?.add(...args);
119
119
  };
120
- const edit = (row) => {
121
- expose.value?.edit(row);
120
+ const edit = (row, ...args) => {
121
+ expose.value?.edit(row, ...args);
122
122
  };
123
123
  const setData = (data) => {
124
124
  expose.value?.setData(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",