From e25ec06753bd5b693001d627e7cc4b10f82453cd Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 18 Jul 2022 14:17:40 +0100 Subject: [PATCH] Refactor on live editor implementation --- src/AppDocumentation.vue | 17 +- src/views/dynamicdialog/DynamicDialogDoc.vue | 223 +++++++++---------- src/views/liveeditor/LiveEditor.vue | 14 +- 3 files changed, 135 insertions(+), 119 deletions(-) diff --git a/src/AppDocumentation.vue b/src/AppDocumentation.vue index 75a5cd153..51baa6f34 100644 --- a/src/AppDocumentation.vue +++ b/src/AppDocumentation.vue @@ -64,7 +64,7 @@ export default { this.data.forEach(el => { dataArr.push(el.split(',')) }) - + dataArr.forEach((el, i) => { tabs.push( @@ -113,11 +113,26 @@ export default { }, renderSource(sourceType, tabs) { if (this.sources && this.sources[sourceType]) { + let extFiles = this.extFiles ? this.extFiles[sourceType] || this.extFiles : null; + extFiles = extFiles && Object.entries(extFiles).map(([key, value], i) => { + if (key === 'index.css' || !value.content) { + return null; + } + + return ( +

+                            {`\n/* ${key.replace('src/components/', '')} */\n`}
+                            {this.renderContent(value)}
+                        
+ ) + }); + tabs.push(

                             {this.renderContent(this.sources[sourceType])}
                         
+ {extFiles}
); } diff --git a/src/views/dynamicdialog/DynamicDialogDoc.vue b/src/views/dynamicdialog/DynamicDialogDoc.vue index 527809d80..6e3fb04ee 100644 --- a/src/views/dynamicdialog/DynamicDialogDoc.vue +++ b/src/views/dynamicdialog/DynamicDialogDoc.vue @@ -1,5 +1,5 @@