useFieldMetaList
- Category:
Composables
- Relate:
getFieldMetaList
onFieldAdd
onFieldDelete
onFieldModify
- Dependencies:
@lark-base-open/js-sdk
- Last Changed: 20 hours ago
提示
该函数需要在一个多维表格中使用,请将本文档作为一个插件在多维表格上使用以查看演示。
演示
显示演示代码
vue
<script setup lang="ts">
import { useFieldMetaList, useTable, useSelection } from "@qww0302/use-bitable"
import { FieldType } from "@lark-base-open/js-sdk"
const { tableId } = useSelection()
const { table } = useTable(tableId)
const { fieldMetaList, pending } = useFieldMetaList(table, {
types: [FieldType.Text, FieldType.Number],
})
</script>
<template>
<div>
<p>Pending: {{ pending }}</p>
<div style="overflow: auto; max-height: 200px">
<ul>
<li v-for="(fieldMeta, index) in fieldMetaList" :key="index">
{{ fieldMeta.name }}[{{ fieldMeta.id }}](type: {{ fieldMeta.type }})
</li>
</ul>
</div>
</div>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
用法
类型声明
显示类型声明
ts
import { FieldType } from "@lark-base-open/js-sdk"
import type { MaybeRefOrGetter } from "vue"
import type { ITable } from "@lark-base-open/js-sdk"
interface FieldMetaListOption {
/**
* Field types
*/
types?: FieldType[]
}
export declare function useFieldMetaList(
table: MaybeRefOrGetter<ITable | null>,
option?: FieldMetaListOption,
): {
fieldMetaList: import("vue").ComputedRef<
(
| import("@lark-base-open/js-sdk").IAttachmentFieldMeta
| import("@lark-base-open/js-sdk").IAutoNumberFieldMeta
| import("@lark-base-open/js-sdk").IBarcodeFieldMeta
| import("@lark-base-open/js-sdk").IButtonUserFieldMeta
| import("@lark-base-open/js-sdk").ICheckboxFieldMeta
| import("@lark-base-open/js-sdk").ISingleLinkFieldMeta
| import("@lark-base-open/js-sdk").ISingleSelectFieldMeta
| import("@lark-base-open/js-sdk").IMultiSelectFieldMeta
| import("@lark-base-open/js-sdk").IDuplexLinkFieldMeta
| import("@lark-base-open/js-sdk").IDateTimeFieldMeta
| import("@lark-base-open/js-sdk").ICurrencyFieldMeta
| import("@lark-base-open/js-sdk").IFormulaFieldMeta
| import("@lark-base-open/js-sdk").IGroupChatFieldMeta
| import("@lark-base-open/js-sdk").ILocationFieldMeta
| import("@lark-base-open/js-sdk").ILookupFieldMeta
| import("@lark-base-open/js-sdk").ICreatedTimeFieldMeta
| import("@lark-base-open/js-sdk").IModifiedTimeFieldMeta
| import("@lark-base-open/js-sdk").ICreatedUserFieldMeta
| import("@lark-base-open/js-sdk").IModifiedUserFieldMeta
| import("@lark-base-open/js-sdk").INumberFieldMeta
| import("@lark-base-open/js-sdk").IPhoneFieldMeta
| import("@lark-base-open/js-sdk").IProgressFieldMeta
| import("@lark-base-open/js-sdk").IRatingFieldMeta
| import("@lark-base-open/js-sdk").ITextFieldMeta
| import("@lark-base-open/js-sdk").IUrlFieldMeta
| import("@lark-base-open/js-sdk").IUserFieldMeta
| import("@lark-base-open/js-sdk").IEmailFieldMeta
| import("@lark-base-open/js-sdk").IObjectFieldMeta
)[]
>
pending: import("vue").Ref<boolean, boolean>
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47