Pre Merge pull request !2 from 崔明辉/feature/useRect

This commit is contained in:
崔明辉 2021-12-02 12:56:49 +00:00 committed by Gitee
commit df1c988d15

View File

@ -13,15 +13,18 @@
```
```js
import { ref } from 'vue';
import { ref,onMounted } from 'vue';
import { useRect } from '@vant/use';
export default {
setup() {
const root = ref();
const rect = useRect(root);
onMounted(()=>{
const rect = useRect(root);
console.log(rect); // -> 元素的大小及其相对于视口的位置
})
return { root };
},