From 9bf713149f8705eb6ace62ab4ef5aa3e57ef1c96 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 10:34:47 +0300 Subject: [PATCH] fix LiveEditor --- src/views/liveeditor/LiveEditor.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/views/liveeditor/LiveEditor.vue b/src/views/liveeditor/LiveEditor.vue index fff1fe85d..5f10d3b10 100644 --- a/src/views/liveeditor/LiveEditor.vue +++ b/src/views/liveeditor/LiveEditor.vue @@ -130,14 +130,17 @@ export default { ${style}` } - let mittComponents = ['ToastDemo', 'OrganizationChartDemo', 'ConfirmDialogDemo', 'ConfirmPopupDemo', 'TerminalDemo', 'SplitButton', 'DeferredContentDemo', 'OverlayPanelDemo', 'FileUploadDemo']; + let mittComponents = ['ToastDemo', 'OrganizationChartDemo', 'ConfirmDialogDemo', 'ConfirmPopupDemo', 'TerminalDemo', 'SplitButtonDemo', 'DeferredContentDemo', 'OverlayPanelDemo', 'FileUploadDemo']; mittComponents.forEach(cmp => { if(name === cmp) { extDependencies['mitt'] = "^2.1.0"; - imports += `import ToastService from "primevue/toastservice"; + imports += `import Toast from "primevue/toast"; +import ToastService from "primevue/toastservice"; `; directives += `app.use(ToastService); +`; + components += `app.component("Toast", Toast); `; } }); @@ -169,11 +172,11 @@ ${style}` }) } - if(name !== 'TooltipDemo' && name !== 'RippleDemo' && name !== 'FloatLabelDemo' && name !== 'InputGroupDemo' && name !== 'InvalidDemo' && name !== 'FormLayoutDemo') { + if(name !== 'ToastDemo' && 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') { + if(name !== 'ToastDemo' && name !== 'FloatLabelDemo' && name !== 'InputGroupDemo' && name !== 'InvalidDemo' && name !== 'FormLayoutDemo') { importElement += `import ${name.slice(0, -4)} from "primevue/${name.slice(0, -4).toLowerCase()}";`; }