File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -182,15 +182,18 @@ class RefImpl<T = any> {
182
182
* @see {@link https://vuejs.org/api/reactivity-advanced.html#triggerref }
183
183
*/
184
184
export function triggerRef ( ref : Ref ) : void {
185
- if ( __DEV__ ) {
186
- ; ( ref as unknown as RefImpl ) . dep . trigger ( {
187
- target : ref ,
188
- type : TriggerOpTypes . SET ,
189
- key : 'value' ,
190
- newValue : ( ref as unknown as RefImpl ) . _value ,
191
- } )
192
- } else {
193
- ; ( ref as unknown as RefImpl ) . dep . trigger ( )
185
+ // ref may be an instance of ObjectRefImpl
186
+ if ( ( ref as unknown as RefImpl ) . dep ) {
187
+ if ( __DEV__ ) {
188
+ ; ( ref as unknown as RefImpl ) . dep . trigger ( {
189
+ target : ref ,
190
+ type : TriggerOpTypes . SET ,
191
+ key : 'value' ,
192
+ newValue : ( ref as unknown as RefImpl ) . _value ,
193
+ } )
194
+ } else {
195
+ ; ( ref as unknown as RefImpl ) . dep . trigger ( )
196
+ }
194
197
}
195
198
}
196
199
You can’t perform that action at this time.
0 commit comments