跳到内容

logicOr

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

OR refs 的条件。

用法

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

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

whenever(logicOr(a, b), () => {
  console.log('either a or b is truthy!')
})

类型声明

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

源码

源码文档

贡献者

Anthony Fu
Anthony Fu
IlyaL
Curt Grimes

更新日志

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

根据 MIT 许可证发布。