Skip to content

Commit 40977d7

Browse files
authored
fix(auto-import): invalidate component options cache (#31)
1 parent 573b71d commit 40977d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/loader.auto-import.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ module.exports = function (content) {
7272

7373
const code = `\nimport {${comp}${hasComp === true && hasDir === true ? ',' : ''}${dir}} from 'quasar'\n` +
7474
(hasComp === true
75-
? `component.options.components = Object.assign(component.options.components || {}, {${comp}})\n`
75+
? `component.options.components = Object.assign(Object.create(component.options.components || null), component.options.components || {}, {${comp}})\n`
7676
: '') +
7777
(hasDir === true
78-
? `component.options.directives = Object.assign(component.options.directives || {}, {${dir}})\n`
78+
? `component.options.directives = Object.assign(Object.create(component.options.directives || null), component.options.directives || {}, {${dir}})\n`
7979
: '')
8080

8181
return index === -1

0 commit comments

Comments
 (0)