From: zhiyuanzmj <260480378@qq.com> Date: Fri, 18 Jul 2025 09:15:20 +0000 (+0800) Subject: fix(runtime-vapor): remove access globalProperties warning (#13609) X-Git-Tag: v3.6.0-alpha.2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fca74b00a86c6039aa05591618539a77aaa72daf;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-vapor): remove access globalProperties warning (#13609) --- diff --git a/packages/runtime-vapor/__tests__/apiCreateVaporApp.spec.ts b/packages/runtime-vapor/__tests__/apiCreateVaporApp.spec.ts index c82d432f1d..6b21e5e556 100644 --- a/packages/runtime-vapor/__tests__/apiCreateVaporApp.spec.ts +++ b/packages/runtime-vapor/__tests__/apiCreateVaporApp.spec.ts @@ -341,7 +341,7 @@ describe('api: createVaporApp', () => { }) }) - test('config.globalProperty', () => { + test.todo('config.globalProperty', () => { const { app } = define({ setup() { return [] @@ -351,7 +351,7 @@ describe('api: createVaporApp', () => { app.config.globalProperties.msg = 'hello world' } catch (e) {} expect( - `app.config.globalProperties is not supported in vapor mode`, + `app.config.globalProperties is not supported in vapor mode components`, ).toHaveBeenWarned() }) }) diff --git a/packages/runtime-vapor/src/apiCreateApp.ts b/packages/runtime-vapor/src/apiCreateApp.ts index ee4c00c880..bcc680eae4 100644 --- a/packages/runtime-vapor/src/apiCreateApp.ts +++ b/packages/runtime-vapor/src/apiCreateApp.ts @@ -88,18 +88,6 @@ function prepareApp() { } function postPrepareApp(app: App) { - if (__DEV__) { - app.config.globalProperties = new Proxy( - {}, - { - set() { - warn(`app.config.globalProperties is not supported in vapor mode.`) - return false - }, - }, - ) - } - app.vapor = true const mount = app.mount app.mount = (container, ...args: any[]) => {