tankhooks

Vue3实用Hooks集合
550 3
Install
npm install tankhooks
Latest Version:1.1.11
Vue:3
License:ISC
Last Updated:Aug 19, 2022
Links: GitHub  ·  npm
Maintainer: ymhczm

tankhooks

针对 Vue3 的实用Hooks集合

安装

$ npm i tankhooks --save
$ yarn add tankhooks

文档

使用文档

使用简介

  获取鼠标点击的位置
    import { useMousePosition } from "tankhooks";
    const { clickY, clickX } = useMousePosition();
  获取滚动的距离
    import { useScrollPosition } from "tankhooks";
    const { scrollY } = useScrollPosition();
  deepCopy对象
    import { useDeepCopy } from "tankhooks";
    const newData = useDeepCopy(data);
  线上进程暂停程序
    import { useSleep } from "tankhooks";
    useSleep(2000)
  点击按钮实现自动复制到剪切板,必须用户触发才可以,不可以直接调用js触发
    import { useCopy } from "tankhooks";
    const copy = async (value) => {
      const result = await useCopy(value);
      if(result==="SUCCESS") {
        console.log("复制到剪切板成功")
      } else if(result==="ERROR"){
        console.log("复制到剪切板失败")
      }
    };
  

Related Packages

v3hooks

针对 Vue3 的实用Hooks集合

8,757 221
zq-vue-hook

easy create form page

313 1
vue-timer-hook

Vue 3 composition API hooks for countdown timers, stopwatches, and live clock st...

189,124
@ui-machines/vue

The vue wrapper for ui-machines

2,309 5,238

Version History

Version Released Vue License
1.1.11 ^3.2.37 ISC
1.1.10 ^3.2.37 ISC
1.1.9 ^3.2.37 ISC
1.1.8 ^3.2.37 ISC
1.1.7 ^3.2.37 ISC