UNPKG

vue-swr-plus

Version:

SWR (stale-while-revalidate) for Vue

13 lines (9 loc) 259 B
import { Plugin } from 'vue' import { useSWR } from './useSWR' const SWRPlugin: Plugin = { install: (app, options) => { app.config.globalProperties.$swr = useSWR // 可以在这里添加全局配置 } } export { SWRPlugin, useSWR }