From 0dc56c181860563eb3544e930c1cb3b0d7a950a6 Mon Sep 17 00:00:00 2001 From: Michiel van der Geest Date: Mon, 19 Feb 2024 09:40:11 +0100 Subject: [PATCH] Added support for dynamic components via is-attribute. --- src/lib/codegenerator/generator.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/codegenerator/generator.js b/src/lib/codegenerator/generator.js index 965cbc2a..5f1a523d 100644 --- a/src/lib/codegenerator/generator.js +++ b/src/lib/codegenerator/generator.js @@ -169,11 +169,11 @@ const generateComponentCode = function ( renderCode.push(` if(!${elm}) { - ${elm} = (context.components && context.components['${ + const componentType = props${counter}['is'] || '${ templateObject[Symbol.for('componentType')] - }'] || component[Symbol.for('components')]['${ - templateObject[Symbol.for('componentType')] - }'] || (() => { console.error('component ${ + }' + + ${elm} = (context.components && context.components[componentType] || component[Symbol.for('components')][componentType] || (() => { console.error('component ${ templateObject[Symbol.for('componentType')] } not found')})).call(null, {props: props${counter}}, ${parent}, component) if (${elm}[Symbol.for('slots')][0]) {