docs: 新增 hooks 文档

This commit is contained in:
就眠仪式 2021-10-25 00:37:08 +08:00
parent daf314ff0c
commit f4182b4b2a
3 changed files with 8 additions and 9 deletions

View File

@ -2,14 +2,12 @@
:::
```html
<div ref='dropdownRef'></div>
<div ref="dropdownRef"></div>
```
```javascript
const dropdownRef = ref<null | HTMLElement>(null)
const dropdownRef = (ref < null) | (HTMLElement > null)
const isClickOutside = useClickOutside(dropdownRef)
watch(isClickOutside, () => {
})
```
watch(isClickOutside, () => {})
```

View File

@ -266,8 +266,9 @@ const zhCN = [
component: () =>
import('../../docs/zh-CN/hooks/useClickOutside.md'),
meta: { title: 'useClickOutside' },
}
]}
},
],
},
],
},
]

View File

@ -73,7 +73,7 @@ export default {
title: 'useClickOutside',
subTitle: '',
path: '/zh-CN/hooks/useClickOutside',
}
},
],
},
]