mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
* Start on m2o * Render preview in m2o * Add icons * Style inline icons * Add editing modal * Disable any linter * Add add-new button * Pass existing selection on to layout * Update v-table to allow for keys-only-selection * Fix batch on tabular
useElementSize
function useElementSize(element: Element): { width: Ref<number>, height: Ref<number> }
Allows you to reactively watch an elements width and height.
Usage
<template>
<div ref="el">
My size is: {{ width }} x {{ height }}
</div>
</template>
<script lang="ts">
import { defineComponent } from '@vue/composition-api';
import { useElementSize } from '@/composables/use-element-size';
export default defineComponent({
setup(props) {
const el = ref<Element>(null);
const { width, height } = useElementSize(el);
return { el, width, height };
}
});
</script>