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.dev.org.tw/logicAnd
*/
export declare function logicAnd(
...args: MaybeRefOrGetter<any>[]
): ComputedRef<boolean>
export { logicAnd as and }
原始碼
貢獻者
變更日誌
v12.8.0
於 2025/3/5v12.3.0
於 2025/1/259f75
- feat(toValue): 棄用 @vueuse/shared
中的 toValue
,改用 Vue 原生功能v12.0.0-beta.1
於 2024/11/21v10.0.0-beta.4
於 2023/4/134d757
- feat(types)!: 將 MaybeComputedRef
重新命名為 MaybeRefOrGetter
0a72b
- feat(toValue): 將 resolveUnref
重新命名為 toValue