0.0.5 • Published 3 years ago
@ayase/vc-align v0.0.5
vc-align
Vue 3 Align Component. Wrapper around https://github.com/yiminghe/dom-align.
rc-align
for vue 3
Install
Usage
<template>
<Align :align="{ points: ['cc', 'cc'] }" :target="() => document.body">
<div />
</Align>
</template>
<script>
import Align from '@ayase/vc-align';
export default {
components: { Align }
};
</script>
API
Props
Prop | Description | Type | Default |
---|---|---|---|
align | same with alignConfig from dom-align | Object | - |
target | a function which returned value or point is used for target from dom-align | () => HTMLElement \| { pageX: number, pageY: number } \| { clientX: number, clientY: number } | () => window |
monitorWindowResize | whether realign when window is resized | boolean | false |
License
MIT