useEnv
- Category:
Composables - Relate:
getEnv - Dependencies:
@lark-base-open/js-sdk - Last Changed: last week
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 { useEnv } from "@qww0302/use-bitable"
const env = useEnv()
</script>
<template>
<p>Environment: {{ env ?? "null" }}</p>
</template>1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Usage
useEnv is a wrapper of getEnv, used to get the current environment information. It can be used to determine whether the current environment is in a Bitable. Its value is null in a non-Bitable environment.
ts
import { useEnv } from "@qww0302/use-bitable"
import { computed } from "vue"
const env = useEnv()
const isBitable = computed(() => !!env.value)1
2
3
4
5
2
3
4
5
Type Declarations
ts
import { Product } from "@lark-base-open/js-sdk"
/**
* Get current environment
*
* 获取当前环境
*
* @returns
*/
export declare function useEnv(): import("vue").Ref<
Product | null,
Product | null
>1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12