@xizs/nuxt-antui 0.0.48 → 0.0.49

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.
@@ -15,7 +15,7 @@ type TableFormLabelsItemType = {
15
15
 
16
16
  export type TableParamsType = {
17
17
  form?: {
18
- labels?: TableFormLabelsItemType[],
18
+ labels?: (TableFormLabelsItemType|(()=>any))[],
19
19
  'v-slots'?: Record<string, ()=>any>,
20
20
  option?: {
21
21
  search?: boolean,
@@ -170,7 +170,9 @@ export default defineComponent({
170
170
  //form 初始化
171
171
  const form = ref<any>({})
172
172
  props.form?.labels?.filter(item=>item.filter==null||item.filter(item)).forEach((item) => {
173
-
173
+ if(typeof item =="function"){
174
+ item(form.value)
175
+ }
174
176
  if (Array.isArray(item.key)) {
175
177
  item.key.forEach((key,index) => {
176
178
  form.value[key] = item.value?.[index]??''
@@ -246,6 +248,9 @@ export default defineComponent({
246
248
  {/* {JSON.stringify(form.value)} */}
247
249
  {props.form?.labels&&<AForm layout="inline gap-2">
248
250
  {props.form?.labels?.map((item: TableFormLabelsItemType) => {
251
+ if(typeof item =="function"){
252
+ return item(form.value)
253
+ }
249
254
  return (
250
255
  <AFormItem label={$t(item.label)}>
251
256
  {FormItems[item.is]?.(form.value,item)}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xizs/nuxt-antui",
3
3
  "type": "module",
4
- "version": "0.0.48",
4
+ "version": "0.0.49",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",