Count: {{ current }}
Function executed immediately and will repeat after 2 seconds.
Count: {{ current }}
Result: {{ data }}
``` -------------------------------- ### Debounce Example with Input Source: https://github.com/inhiblabcore/vue-hooks-plus/blob/master/docs/zh/hooks/useRequest/debounce.md This example demonstrates how to use debounce with an input field. Rapid typing in the input will trigger `run` multiple times, but due to the debounce setting (1000ms), the request will only execute 1000ms after the last input event. ```vue ``` -------------------------------- ### Default Request Example Source: https://github.com/inhiblabcore/vue-hooks-plus/blob/master/packages/hooks/src/useRequest/docs/basic/index.zh-CN.md Demonstrates the default behavior of `useRequest` where the service function is automatically executed upon component initialization. ```vue{{ data }}
``` -------------------------------- ### Basic useDrop and useDrag Usage Source: https://github.com/inhiblabcore/vue-hooks-plus/blob/master/docs/en/hooks/useDrop-useDrag.md Demonstrates a basic setup for accepting files, URLs, text, or other dropped content within a designated drop area. ```vue{{ data }}
``` -------------------------------- ### Vue Infinite Scroll Demo Source: https://github.com/inhiblabcore/vue-hooks-plus/blob/master/docs/zh/hooks/useInfiniteScroll.md A basic Vue component demonstrating the useInfiniteScroll hook. This example likely showcases the initial setup and data fetching. ```vueLatest Message: {{ latestMessage }}
Ready State: {{ readyState }}
Data 1: {{ data1 }}
Data 2: {{ data2 }}
Message will appear after 2 seconds.
Request status: {{ status }}
Data: {{ data }}
``` -------------------------------- ### Configure AutoImport for Vite Source: https://github.com/inhiblabcore/vue-hooks-plus/blob/master/README.md Set up `unplugin-auto-import` with `VueHooksPlusResolver` for Vite to automatically import hooks. This requires installing `unplugin-auto-import` and `@vue-hooks-plus/resolvers`. ```typescript import AutoImport from 'unplugin-auto-import/vite' import { VueHooksPlusResolver } from '@vue-hooks-plus/resolvers' export const AutoImportDeps = () => AutoImport({ imports: ['vue', 'vue-router'], include: [/\[tj]sx?$/, /\.vue$/, /\.vue\?vue/, /\.md$/], dts: 'src/auto-imports.d.ts', resolvers: [VueHooksPlusResolver()], }) ``` -------------------------------- ### Basic Usage of useWebSocket Source: https://github.com/inhiblabcore/vue-hooks-plus/blob/master/docs/zh/hooks/useWebSocket.md Demonstrates the fundamental usage of the useWebSocket hook. This snippet shows how to establish a WebSocket connection and utilize its basic functionalities. ```vueReady state: {{ readyState }}
Latest message: {{ latestMessage }}
count: {{ count }}
Press ArrowUp or ArrowDown
Online: {{ networkState.online }}
RTT: {{ networkState.rtt }}
Type: {{ networkState.type }}
Scroll down
End
Directions: {{ directions }}
``` -------------------------------- ### useFetchs Basic Usage Source: https://github.com/inhiblabcore/vue-hooks-plus/blob/master/docs/zh/hooks/useFetchs.md Demonstrates the basic usage of useFetchs for managing the state of multiple concurrent requests. ```vueCount: {{ count }}
Scroll down
End
Directions: {{ directions }}
``` -------------------------------- ### Basic Usage of useKeyPress Source: https://github.com/inhiblabcore/vue-hooks-plus/blob/master/docs/zh/hooks/useKeyPress.md Demonstrates the fundamental use of the useKeyPress hook. It supports listening for individual keys using their key codes or defined aliases. Press ArrowUp or ArrowDown to see it in action. ```vuePress ArrowUp or ArrowDown
Mouse position: {{ x }} {{ y }}