JSPM

  • Created
  • Published
  • Downloads 72
  • Score
    100M100P100Q45185F
  • License MIT

High quality and reliable Vue3 Hooks library

Package Exports

  • v3-use
  • v3-use/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (v3-use) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

v3-use

v3-use is a high-quality and reliable Vue3 Hooks library. Using vue3.x composition api in react-hooks style.

Install

npm install v3-use

Usage

import { useBoolean } from 'v3-use'
const [state, { toggle, setFalse, setTrue }] = useBoolean()

Hooks

  • State

  • Scene

  • Dom

  • Effect

    • useTimeout — 一个可以处理 setTimeout 的 Hook
    • useInterval — 一个可以处理 setInterval 的 Hook
  • LifeCycle

    • useEffect — 像 React 一样使用 useEffect 的 Hook
    • useEffectOnce — 只在mountedbeforeUnmount阶段执行的生命周期
    • useUpdateEffect — onUpdated 钩子函数封装,支持传入依赖监听
    • useLogger — 在控制台记录经历的生命周期(mounted,updated,breforeUnmount)