Skip to content

watchImmediate

类别
导出大小
117 B
最近修改
2 days ago

用于监视 {immediate: true} 值的快捷方式

🌐 Shorthand for watching value with {immediate: true}

用法

🌐 Usage

类似于 watch,但是有 { immediate: true }

🌐 Similar to watch, but with { immediate: true }

ts
import { 
watchImmediate
} from '@vueuse/core'
const
obj
=
ref
('vue-use')
// changing the value from some external store/composables
obj
.
value
= 'VueUse'
watchImmediate
(
obj
, (
updated
) => {
console
.
log
(
updated
) // Console.log will be logged twice
})