update LiveEditor

pull/880/head
Tuğçe Küçükoğlu 2021-01-20 09:43:51 +03:00
parent 3ac8b3fa16
commit 7accb3479c
1 changed files with 19 additions and 9 deletions

View File

@ -130,14 +130,22 @@ export default {
${style}` ${style}`
} }
if(name !== 'FloatLabelDemo') { let mittComponents = ['ToastDemo', 'OrganizationChartDemo', 'ConfirmDialogDemo', 'ConfirmPopupDemo', 'TerminalDemo', 'SplitButton', 'DeferredContentDemo', 'OverlayPanelDemo', 'FileUploadDemo'];
importElement += `import ${name.slice(0, -4)} from "primevue/${name.slice(0, -4).toLowerCase()}";`;
}
if(name === 'ToastDemo'){ mittComponents.forEach(cmp => {
imports += `import ToastService from "primevue/toastservice"; 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)});`; 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'){ if(name === 'TooltipDemo' || name === 'RippleDemo'){
directives += `app.directive("${name.slice(0, -4).toLowerCase()}", ${name.slice(0, -4)}); 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"; extDependencies['chart.js'] = "2.7.3";
} }
let mittComponents = ['ToastDemo', 'OrganizationChartDemo', 'ConfirmDialogDemo', 'ConfirmPopupDemo', 'TerminalDemo'];
mittComponents.forEach(cmp => { mittComponents.forEach(cmp => {
if(name === cmp) { if(name === cmp) {
extDependencies['mitt'] = "^2.1.0"; extDependencies['mitt'] = "^2.1.0";