From 9b232b8dd414575bc1b05ea140d8f16b92d6dac5 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Thu, 12 Mar 2020 18:01:26 +0800 Subject: [PATCH] fix(ts): merge components #1400 --- .../vue-loader/lib/runtime/componentNormalizer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js b/packages/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js index 5985bc6af0..425a03e67d 100644 --- a/packages/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js +++ b/packages/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js @@ -23,7 +23,15 @@ export default function normalizeComponent ( // fixed by xxxxxx auto components if (components) { - options.components = Object.assign(components, options.components || {}) + if (!options.components) { + options.components = {} + } + var hasOwn = Object.prototype.hasOwnProperty + for (var name in components) { + if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) { + options.components[name] = components[name] + } + } } // fixed by xxxxxx renderjs if (renderjs) { -- GitLab