useUserId
- Category:
Composables
- Relate:
getUserId
- 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 { useUserId } from "@qww0302/use-bitable"
const userId = useUserId()
</script>
<template>
<p>UserId: {{ userId ?? "null" }}</p>
</template>
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Usage
useUserId
is a wrapper of getUserId
, used to get the current user ID
.
ts
import { useUserId } from "@qww0302/use-bitable"
const userId = useUserId()
1
2
3
2
3
Type Declarations
ts
/**
* Get current user ID
*
* 获取当前用户 ID
*
* @returns
*/
export declare function useUserId(): import("vue").Ref<string | null>
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8