UNPKG
vue-swr-plus
Version:
latest (0.1.0)
0.1.0
SWR (stale-while-revalidate) for Vue
vue-swr-plus
/
src
/
index.ts
13 lines
(9 loc)
•
259 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
import
{
Plugin
}
from
'vue'
import
{ useSWR }
from
'./useSWR'
const
SWRPlugin
:
Plugin
= {
install
:
(
app, options
) =>
{ app.
config
.
globalProperties
.
$swr
= useSWR
// 可以在这里添加全局配置
} }
export
{
SWRPlugin
, useSWR }