logicAnd
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 }
源码
贡献者
更新日志
v12.8.0
on 3/5/2025v12.3.0
on 1/2/202559f75
- feat(toValue): 弃用 @vueuse/shared
中的 toValue
,支持 Vue 的原生v12.0.0-beta.1
on 11/21/2024v10.0.0-beta.4
on 4/13/20234d757
- feat(types)!: 将 MaybeComputedRef
重命名为 MaybeRefOrGetter
0a72b
- feat(toValue): 将 resolveUnref
重命名为 toValue