From 7accb3479c2f9616d4da62c100baedbe98e13964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 20 Jan 2021 09:43:51 +0300 Subject: [PATCH] update LiveEditor --- src/views/liveeditor/LiveEditor.vue | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/views/liveeditor/LiveEditor.vue b/src/views/liveeditor/LiveEditor.vue index d1245558a..fff1fe85d 100644 --- a/src/views/liveeditor/LiveEditor.vue +++ b/src/views/liveeditor/LiveEditor.vue @@ -130,14 +130,22 @@ export default { ${style}` } - if(name !== 'FloatLabelDemo') { - importElement += `import ${name.slice(0, -4)} from "primevue/${name.slice(0, -4).toLowerCase()}";`; - } + let mittComponents = ['ToastDemo', 'OrganizationChartDemo', 'ConfirmDialogDemo', 'ConfirmPopupDemo', 'TerminalDemo', 'SplitButton', 'DeferredContentDemo', 'OverlayPanelDemo', 'FileUploadDemo']; - if(name === 'ToastDemo'){ - imports += `import ToastService from "primevue/toastservice"; + mittComponents.forEach(cmp => { + if(name === cmp) { + extDependencies['mitt'] = "^2.1.0"; + imports += `import ToastService from "primevue/toastservice"; `; - directives += `app.use(ToastService); + directives += `app.use(ToastService); +`; + } + }); + + if(name === 'ConfirmDialogDemo' || name === 'ConfirmPopupDemo') { + imports += `import ConfirmationService from "primevue/confirmationservice"; +`; + directives += `app.use(ConfirmationService); `; } @@ -161,10 +169,14 @@ ${style}` }) } - if(name !== 'TooltipDemo' && name !== 'RippleDemo' && name !== 'FloatLabelDemo') { + if(name !== 'TooltipDemo' && name !== 'RippleDemo' && name !== 'FloatLabelDemo' && name !== 'InputGroupDemo' && name !== 'InvalidDemo' && name !== 'FormLayoutDemo') { element += `app.component("${name.slice(0, -4)}", ${name.slice(0, -4)});`; } + if(name !== 'FloatLabelDemo' && name !== 'InputGroupDemo' && name !== 'InvalidDemo' && name !== 'FormLayoutDemo') { + importElement += `import ${name.slice(0, -4)} from "primevue/${name.slice(0, -4).toLowerCase()}";`; + } + if(name === 'TooltipDemo' || name === 'RippleDemo'){ directives += `app.directive("${name.slice(0, -4).toLowerCase()}", ${name.slice(0, -4)}); `; @@ -500,8 +512,6 @@ ${services[this.service]} extDependencies['chart.js'] = "2.7.3"; } - let mittComponents = ['ToastDemo', 'OrganizationChartDemo', 'ConfirmDialogDemo', 'ConfirmPopupDemo', 'TerminalDemo']; - mittComponents.forEach(cmp => { if(name === cmp) { extDependencies['mitt'] = "^2.1.0";