From 06244cba806e11cb2a710950bcf8d12d2d3f2181 Mon Sep 17 00:00:00 2001
From: Paolo Caleffi
Date: Mon, 27 Apr 2020 20:08:29 +0200
Subject: [PATCH] fix(typescript): allow auto-import when using TS Class API
Closes https://github.com/quasarframework/quasar/issues/6803
---
lib/loader.auto-import.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/loader.auto-import.js b/lib/loader.auto-import.js
index 7e378f8..f1f9aa1 100644
--- a/lib/loader.auto-import.js
+++ b/lib/loader.auto-import.js
@@ -72,10 +72,10 @@ module.exports = function (content) {
const code = `\nimport {${comp}${hasComp === true && hasDir === true ? ',' : ''}${dir}} from 'quasar'\n` +
(hasComp === true
- ? `component.options.components = Object.assign({${comp}}, component.options.components || {})\n`
+ ? `component.options.components = Object.assign(component.options.components || {}, {${comp}})\n`
: '') +
(hasDir === true
- ? `component.options.directives = Object.assign({${dir}}, component.options.directives || {})\n`
+ ? `component.options.directives = Object.assign(component.options.directives || {}, {${dir}})\n`
: '')
return index === -1