File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ export default function get(options: UseGetOptions): UseGetData {
58
58
function getId ( ) : null | string | number {
59
59
return isRef ( id ) ? id . value : id || null
60
60
}
61
+ function getParams ( ) : Params {
62
+ return isRef ( params ) ? params . value : params
63
+ }
61
64
62
65
const servicePath = computed < string > ( ( ) => model . servicePath )
63
66
const state = reactive < UseGetState > ( {
@@ -111,9 +114,16 @@ export default function get(options: UseGetOptions): UseGetData {
111
114
}
112
115
113
116
watch (
114
- ( ) => [ getId ( ) , params ] ,
115
- ( [ id , params ] ) => {
116
- get ( id , params )
117
+ ( ) => getId ( ) ,
118
+ id => {
119
+ get ( id , getParams ( ) )
120
+ } ,
121
+ { lazy }
122
+ )
123
+ watch (
124
+ ( ) => getParams ( ) ,
125
+ params => {
126
+ get ( getId ( ) , params )
117
127
} ,
118
128
{ lazy }
119
129
)
You can’t perform that action at this time.
0 commit comments