diff --git a/packages/@uvue/core/lib/initApp.js b/packages/@uvue/core/lib/initApp.js index c4d6ffe..8e02c7f 100644 --- a/packages/@uvue/core/lib/initApp.js +++ b/packages/@uvue/core/lib/initApp.js @@ -26,7 +26,10 @@ export default async (options, context) => { // Inject function const inject = (key, value) => { if (!/^\$/.test(key)) key = `$${key}`; - context[key] = Vue.prototype[key] = value; + context[key] = value; + if (!Object.prototype.hasOwnProperty.call(Vue.prototype, key)) { + Vue.prototype[key] = value; + } if (options.store) { options.store[key] = value; }