cc1-form 1.1.39 → 1.1.41

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.
@@ -585,7 +585,34 @@ export type CurdOptions<T = any> = {
585
585
  /**
586
586
  * 自定义组件属性
587
587
  */
588
- [key: string]: any;
588
+ [key: string]: Partial<{
589
+ [key: string]: any;
590
+ /**
591
+ * 自定义事件
592
+ */
593
+ on: any;
594
+ /**
595
+ * 数据源
596
+ * @example
597
+ * //异步请求数据后调用方法dataApi获取数据源,返回数据源后不再进行请求,如果返回false不进行更改之前的数据
598
+ * dataApi: async (param?: T) => {
599
+ * const res = await api.get(param)
600
+ * return res
601
+ * }
602
+ */
603
+ data: CurdSelectData[];
604
+ /** 获取数据回调,如果传入,会在初始化、新增、编辑时调用,返回数据源后不再进行请求,如果返回false不进行更改之前的数据 */
605
+ dataApi: (param: T, type: 'init' | 'update') => CurdSelectData[] | Promise<CurdSelectData[]> | boolean;
606
+ /** 获取数据挂载配置 */
607
+ dataApiConfig: Partial<{
608
+ /** 是否只获取一次数据 - 默认为true */
609
+ once: boolean;
610
+ /** 是否在初始化时获取数据 - 默认为true */
611
+ init: boolean;
612
+ /** 是否在编辑或新增操作前获取数据 - 默认为true */
613
+ update: boolean;
614
+ }>;
615
+ }> | undefined;
589
616
  /**
590
617
  * 输入框选项-更多配置:https://element-plus.org/zh-CN/component/input#attributes
591
618
  */
@@ -647,14 +674,14 @@ export type CurdOptions<T = any> = {
647
674
  /** 获取数据回调,如果传入,会在初始化、新增、编辑时调用,返回数据源后不再进行请求,如果返回false不进行更改之前的数据 */
648
675
  dataApi: (param: T, type: 'init' | 'update') => CurdSelectData[] | Promise<CurdSelectData[]> | boolean;
649
676
  /** 获取数据挂载配置 */
650
- dataApiConfig: {
677
+ dataApiConfig: Partial<{
651
678
  /** 是否只获取一次数据 - 默认为true */
652
679
  once: boolean;
653
680
  /** 是否在初始化时获取数据 - 默认为true */
654
681
  init: boolean;
655
682
  /** 是否在编辑或新增操作前获取数据 - 默认为true */
656
683
  update: boolean;
657
- };
684
+ }>;
658
685
  }>;
659
686
  /**
660
687
  * 树选择组件属性 - 更多配置:https://element-plus.org/zh-CN/component/tree-select#attributes
@@ -740,14 +767,14 @@ export type CurdOptions<T = any> = {
740
767
  /** 获取数据回调,如果传入,会在初始化、新增、编辑时调用,返回数据源后不再进行请求,如果返回false不进行更改之前的数据 */
741
768
  dataApi: (param: T, type: 'init' | 'update') => CurdSelectData[] | Promise<CurdSelectData[]> | boolean;
742
769
  /** 获取数据挂载配置 */
743
- dataApiConfig: {
770
+ dataApiConfig: Partial<{
744
771
  /** 是否只获取一次数据 - 默认为true */
745
772
  once: boolean;
746
773
  /** 是否在初始化时获取数据 - 默认为true */
747
774
  init: boolean;
748
775
  /** 是否在编辑或新增操作前获取数据 - 默认为true */
749
776
  update: boolean;
750
- };
777
+ }>;
751
778
  }>;
752
779
  };
753
780
  export interface CurdFormColumn<T = any> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc1-form",
3
- "version": "1.1.39",
3
+ "version": "1.1.41",
4
4
  "description": "我来助你-表单组件库",
5
5
  "repository": {
6
6
  "type": "git",