跳到主要内容

logicAnd

类别
导出大小
149 B
@vueuse/math
最后更改
5 天前
别名
and
相关

refs 的 AND 条件。

用法

ts
import { whenever } from '@vueuse/core'
import { logicAnd } from '@vueuse/math'

const a = ref(true)
const b = ref(false)

whenever(logicAnd(a, b), () => {
  console.log('both a and b are now truthy!')
})

类型声明

typescript
/**
 * `AND` conditions for refs.
 *
 * @see https://vueuse.org.cn/logicAnd
 */
export declare function logicAnd(
  ...args: MaybeRefOrGetter<any>[]
): ComputedRef<boolean>
export { logicAnd as and }

源码

SourceDocs

贡献者

Anthony Fu
Anthony Fu
Curt Grimes
IlyaL

更新日志

v12.8.0 on 3/5/2025
7432f - feat(types): deprecate MaybeRefMaybeRefOrGetter,支持 Vue 的原生 (#4636)
v12.3.0 on 1/2/2025
59f75 - feat(toValue): 弃用 @vueuse/shared 中的 toValue,支持 Vue 的原生
v12.0.0-beta.1 on 11/21/2024
0a9ed - feat!: 移除 Vue 2 支持,优化包并清理 (#4349)
v10.0.0-beta.4 on 4/13/2023
4d757 - feat(types)!: 将 MaybeComputedRef 重命名为 MaybeRefOrGetter
0a72b - feat(toValue): 将 resolveUnref 重命名为 toValue

根据 MIT 许可证发布。