json-vue-hooks
v1.3.5
Published
Vue hooks library
Downloads
16
Maintainers
Readme
Json-Vue-Hooks
vue的hooks, 用法和react的ahooks用法一样, 不过目前只有少量hooks可用
常用的useState
, useBoolean
, useArray
, useToggle
, useScroll
, useDebounce
, useComponents
, useThrottle
和 useTimeSync
。
Vue's hooks usage is similar to React's AHooks, although there are currently only a limited number of hooks available. Some commonly used hooks include useState
, useBoolean
, useArray
, useToggle
, useScroll
, useDebounce
, useComponents
, and useThrottle
.
当前更新(Current Updates)
- useSocket: 用法:
const [socket, {send, close}] = useSocket(url, optioins);
- 用途(Purpose): 创建websocket
- 参数(options):
- heartBeatDelay(心跳间隔时间, 单位:秒)
- heartBeatContent(心跳发送的消息内容)
- reconnectMax(最大重连次数)
- onOpen(连接成功监听)
- onClose(连接关闭监听)
- onMessage(接收到消息监听)
- onError(连接错误监听)