Skip to content

Commit 371078c

Browse files
committed
fix: use correct vm based on Reflect.ownKeys
1 parent 9962e5b commit 371078c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/mount.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,13 @@ export function mount(
425425

426426
// mount the app!
427427
const vm = app.mount(el)
428+
const appRef = vm.$refs[MOUNT_COMPONENT_REF] as ComponentPublicInstance
428429

429-
const App = vm.$refs[MOUNT_COMPONENT_REF] as ComponentPublicInstance
430-
return createWrapper(app, App, setProps)
430+
const warnSave = console.warn
431+
console.warn = () => {}
432+
const $vm = Reflect.ownKeys(appRef).length ? appRef : vm
433+
console.warn = warnSave
434+
return createWrapper(app, $vm, setProps)
431435
}
432436

433437
export const shallowMount: typeof mount = (component: any, options?: any) => {

0 commit comments

Comments
 (0)