fix liveeditor

pull/840/head
Tuğçe Küçükoğlu 2021-01-05 18:21:35 +03:00
parent 890c5045df
commit da17d6fe45
2 changed files with 19 additions and 29 deletions

View File

@ -123,6 +123,7 @@ export default {
_files[`src/components/${name}${extension}`] = {
content: `
${content}
</${scriptText}>
`
}
@ -133,11 +134,11 @@ import "primevue/resources/themes/saga-blue/theme.css";
import "primevue/resources/primevue.min.css";
import "primeicons/primeicons.css";
import App from "./App.vue";
import Button from "primevue/button";
import ${this.name.slice(0, -4)} from "primevue/${this.name.slice(0, -4).toLowerCase()}";
import PrimeVue from "primevue/config";
const app = createApp(App);
app.use(PrimeVue, { ripple: true });
app.component("Button", Button);
app.component("${this.name.slice(0, -4)}", ${this.name.slice(0, -4)});
app.mount("#app");
`
@ -416,16 +417,11 @@ img.flag {
if (this.service) {
_files[`src/service/${this.service}${extension}`] = {
_files[`src/service/${this.service}.js`] = {
content: services[this.service]
}
extDependencies['axios'] = "^0.19.0";
extDependencies['@babel/cli'] = "^7.4.4";
extDependencies['@vue/cli-plugin-babel'] = "~4.5.0";
extDependencies['@vue/cli-service'] = "~4.5.0";
extDependencies['@vue/compiler-sfc'] = "^3.0.0";
extDependencies['core-js'] = "^3.6.5";
}
if (this.data) {

View File

@ -1,56 +1,50 @@
const services = {
'CountryService': `
import axios from 'axios'
import axios from 'axios';
export class CountryService {
export default class CountryService {
getCountries() {
return axios.get('data/countries.json')
.then(res => res.data.data);
return axios.get('data/countries.json').then(res => res.data.data);
}
}
`,
'CustomerService': `
import axios from 'axios';
export class CustomerService {
export default class CustomerService {
getCustomersSmall() {
return axios.get('data/customers-small.json')
.then(res => res.data.data);
return axios.get('data/customers-small.json').then(res => res.data.data);
}
getCustomersMedium() {
return axios.get('data/customers-medium.json')
.then(res => res.data.data);
return axios.get('data/customers-medium.json').then(res => res.data.data);
}
getCustomersLarge() {
return axios.get('data/customers-large.json')
.then(res => res.data.data);
return axios.get('data/customers-large.json').then(res => res.data.data);
}
getCustomersXLarge() {
return axios.get('data/customers-xlarge.json')
.then(res => res.data.data);
return axios.get('data/customers-xlarge.json').then(res => res.data.data);
}
}
`,
'EventService': `
import axios from 'axios';
export class EventService {
export default class EventService {
getEvents() {
return axios.get('data/events.json')
.then(res => res.data.data);
return axios.get('data/events.json').then(res => res.data.data);
}
}
`,
'NodeService': `
import axios from 'axios';
export class NodeService {
export default class NodeService {
getTreeTableNodes() {
return axios.get('data/treetablenodes.json')
@ -61,18 +55,18 @@ export class NodeService {
return axios.get('data/treenodes.json')
.then(res => res.data.root);
}
}
`,
'PhotoService': `
import axios from 'axios';
export class PhotoService {
export default class PhotoService {
getImages() {
return axios.get('data/photos.json')
.then(res => res.data.data);
return axios.get('data/photos.json').then(res => res.data.data);
}
}
}
`,
'ProductService': `
import axios from 'axios';