10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2045ab commit bb5a629Copy full SHA for bb5a629
src/plugins/modals.ts
@@ -130,8 +130,17 @@ export async function $showModal<T = any, P = any>(
130
view.nativeView?.closeModal(...args);
131
};
132
133
- view.context.config.globalProperties.$closeModal = closeModal;
134
- view.context.config.globalProperties.$modal = { close: closeModal };
+ // clone the config and globalProperties to avoid mutating the root app's config/globalProperties
+ const context = view.context;
135
+ context.config = Object.assign({}, context.config);
136
+ context.config.globalProperties = Object.assign(
137
+ {},
138
+ context.config.globalProperties,
139
+ {
140
+ $closeModal: closeModal,
141
+ $modal: { close: closeModal },
142
+ },
143
+ );
144
145
view.mount(root);
146
openModal();
0 commit comments