layui/docs/docs/zh-CN/hooks/useClickOutside.md
2021-10-26 01:13:23 +08:00

254 B

::: title useClickOutside :::

<div ref="dropdownRef"></div>
const dropdownRef = (ref < null) | (HTMLElement > null)
const isClickOutside = useClickOutside(dropdownRef)

watch(isClickOutside, () => {
    // do something
})