Update LiveEditor

pull/756/head
Tuğçe Küçükoğlu 2021-01-08 12:07:35 +03:00
parent 6616c91fc4
commit e651adb9c6
1 changed files with 8 additions and 8 deletions

View File

@ -137,12 +137,7 @@ ${style}`
components += `app.component("${comp}", ${comp}); components += `app.component("${comp}", ${comp});
`; `;
}) })
} else { }
imports = `import ${this.name.slice(0, -4)} from "primevue/${this.name.slice(0, -4).toLowerCase()}";
`;
components = `app.component("${this.name.slice(0, -4)}", ${this.name.slice(0, -4)});
`;
}
_files['src/main.js'] = { _files['src/main.js'] = {
content: `import { createApp } from "vue"; content: `import { createApp } from "vue";
@ -152,9 +147,11 @@ import "primevue/resources/primevue.min.css";
import "primeicons/primeicons.css"; import "primeicons/primeicons.css";
import App from "./App.vue"; import App from "./App.vue";
import PrimeVue from "primevue/config"; import PrimeVue from "primevue/config";
import ${this.name.slice(0, -4)} from "primevue/${this.name.slice(0, -4).toLowerCase()}";
${imports} ${imports}
const app = createApp(App); const app = createApp(App);
app.use(PrimeVue, { ripple: true }); app.use(PrimeVue, { ripple: true });
app.component("${this.name.slice(0, -4)}", ${this.name.slice(0, -4)});
${components} ${components}
app.mount("#app"); app.mount("#app");
` `
@ -191,8 +188,7 @@ export default {
</${scriptText}> </${scriptText}>
<style lang="scss"> <style lang="scss">
@import './App.scss'; @import './App.scss';
</style> </style>`
`
} }
_files['src/App.scss'] = { _files['src/App.scss'] = {
@ -457,6 +453,10 @@ img.flag {
extDependencies['@fullcalendar/timegrid'] = "5.4.0"; extDependencies['@fullcalendar/timegrid'] = "5.4.0";
} }
if(this.name === 'OrganizationChartDemo') {
extDependencies['mitt'] = "^2.1.0";
}
return this.createSandboxParameters(`${name}${extension}`, _files, extDependencies); return this.createSandboxParameters(`${name}${extension}`, _files, extDependencies);
} }
} }