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
Using vue3.x composition api in react-hooks style.
Install
npm install v3-use
# or
yarn add v3-use
Usage
<template>
<div>{{state}}</div>
<button @click="toggle">toggle()</button>
<button @click="setFalse">setFalse()</button>
<button @click="setTrue">setTrue()</button>
</template>
<script setup>
import { useBoolean } from "v3-use";
const [state, { toggle, setFalse, setTrue }] = useBoolean();
</script>
Hooks
- State
useBoolean
— 管理 boolean 值的 HookuseState
— 管理 state 的 Hook