
分享一个很实用的工具库 VueUse,它是基于 Vue Composition Api,也就是组合式API。支持在Vue2和Vue3项目中进行使用,据说是目前世界上Star最高的同类型库之一。

它的初衷就是将一切原本并不支持响应式的 JS API 变得支持响应式,省去程序员自己写相关代码。
官方地址:
中文地址:
github:
功能目录:

功能演示:
1、白天黑夜模式切换

2、使元素可拖拽

3、元素尺寸大小响应式

4、响应式获取鼠标相对于元素的位置

5、剪贴板

6、使用吸管工具吸取颜色

7、选择文件

8、手动触发的 watch

总结:
使用 VueUse 你只需要短短几行代码即可实现复杂的效果。系统所需要的功能它都早已经为我们准备好了。关于它的更多操作,就不再一一演示,有兴趣的朋友可以移步到官网查看。