1.0.3 • Published 8 months ago

@sanjeever/vue-hook v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@sanjeever/vue-hook

Collection of essential Vue Composition Utilities

View on npmjs

Usage

For Vue3

npm i @sanjeever/vue-hook

without

<script setup lang="ts">
import { ref } from 'vue'

const divInstance = ref<HTMLDivElement>()
const clientHeight = divInstance.value?.clientHeight // <-- 'divInstance.value' is possibly 'undefined'.
</script>

<template>
  <div ref="divInstance" />
</template>

with

<script setup lang="ts">
import { useInstance } from '@sanjeever/vue-hook'

const divInstance = useInstance<typeof HTMLDivElement>()
const clientHeight = divInstance.value.clientHeight
</script>

<template>
  <div ref="divInstance" />
</template>
1.0.3

8 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago