0.0.7 • Published 11 months ago

petite-vue-hooks v0.0.7

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

petite-vue-hooks

A tiny vue hooks as its name.

It is wip. Don't use it in production.

Features

Installation

npm i petite-vue-hooks
# or yarn
yarn add petite-vue-hooks
# or pnpm
pnpm add petite-vue-hooks

Usage

<script setup>
  import { useSessionStorage } from 'petit-vue-hooks'

  // reactive sessionStorage 
  const [age_ss] = useSessionStorage('age', 'sessionStorage value')

  function changeAge() {
    age_ss.value = 'reset sessionStorage ' + Math.random()
  }
</script>

<template>
  <h3>{{ age_ss }}</h3>
  <button @click="changeAge">change age_ss</button>
</template>