@ayase/vc-align

align ui component for vue 3

Usage no npm install needed!

<script type="module">
  import ayaseVcAlign from 'https://cdn.skypack.dev/@ayase/vc-align';
</script>

README

vc-align

Vue 3 Align Component. Wrapper around https://github.com/yiminghe/dom-align.

NPM version David dm node version

rc-align for vue 3

Install

vc-align

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