Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set global provides before running vue plugins #2423

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/createInstance.ts
Expand Up @@ -266,6 +266,14 @@ export function createInstance(
}
}

// provide any values passed via provides mounting option
if (global.provide) {
for (const key of Reflect.ownKeys(global.provide)) {
// @ts-ignore: https://github.com/microsoft/TypeScript/issues/1863
app.provide(key, global.provide[key])
}
}

// use and plugins from mounting options
if (global.plugins) {
for (const plugin of global.plugins) {
Expand Down Expand Up @@ -296,14 +304,6 @@ export function createInstance(
app.directive(key, global.directives[key])
}

// provide any values passed via provides mounting option
if (global.provide) {
for (const key of Reflect.ownKeys(global.provide)) {
// @ts-ignore: https://github.com/microsoft/TypeScript/issues/1863
app.provide(key, global.provide[key])
}
}

// stubs
// even if we are using `mount`, we will still
// stub out Transition and Transition Group by default.
Expand Down