File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ describe('api: watch', () => {
187
187
} )
188
188
189
189
// #9916
190
- it ( 'directly watching shallow reactive array' , async ( ) => {
190
+ it ( 'watching shallow reactive array with deep: false ' , async ( ) => {
191
191
class foo {
192
192
prop1 : ShallowRef < string > = shallowRef ( '' )
193
193
prop2 : string = ''
@@ -198,7 +198,7 @@ describe('api: watch', () => {
198
198
199
199
const collection = shallowReactive ( [ obj1 , obj2 ] )
200
200
const cb = vi . fn ( )
201
- watch ( collection , cb )
201
+ watch ( collection , cb , { deep : false } )
202
202
203
203
collection [ 0 ] . prop1 . value = 'foo'
204
204
await nextTick ( )
Original file line number Diff line number Diff line change @@ -225,8 +225,8 @@ function doWatch(
225
225
const reactiveGetter = ( source : object ) =>
226
226
deep === true
227
227
? source // traverse will happen in wrapped getter below
228
- : // for shallow or deep: false, only traverse root-level properties
229
- traverse ( source , isShallow ( source ) || deep === false ? 1 : undefined )
228
+ : // for deep: false, only traverse root-level properties
229
+ traverse ( source , deep === false ? 1 : undefined )
230
230
231
231
let getter : ( ) => any
232
232
let forceTrigger = false
You can’t perform that action at this time.
0 commit comments