Skip to content

Collection of essential Vue Composition Utilities

Notifications You must be signed in to change notification settings

Sanjeever/vue-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@sanjeever/vue-hook

Collection of essential Vue Composition Utilities

Version

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>

About

Collection of essential Vue Composition Utilities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published