onTableAdd
- Category:
Events
- Relate:
onTableAdd
- Dependencies:
@lark-base-open/js-sdk
- Last Changed: 2 weeks ago
Notice
This function needs to use in Base, please use this website as a plugin in a Base to see the demo.
Demo
Show demo code
vue
<script setup lang="ts">
import { onTableAdd } from "@qww0302/use-bitable"
import type { IEventCbCtx } from "@lark-base-open/js-sdk"
import { ref } from "vue"
const ev = ref<IEventCbCtx>()
onTableAdd((e) => {
ev.value = e
})
</script>
<template>
<div>
Try to add a table:
<span v-if="ev">You have added a table. </span>
<pre>{{ JSON.stringify(ev, null, 2) }}</pre>
</div>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Usage
Type Declarations
ts
import type { IEventCbCtx } from "@lark-base-open/js-sdk"
/**
* Listen to table add event
*
* 监听表格添加事件
*
* @param callback
* @returns
*/
export declare function onTableAdd(
callback: (ev: IEventCbCtx) => void,
): () => void
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12