fix liveeditor
parent
890c5045df
commit
da17d6fe45
|
@ -123,6 +123,7 @@ export default {
|
||||||
_files[`src/components/${name}${extension}`] = {
|
_files[`src/components/${name}${extension}`] = {
|
||||||
content: `
|
content: `
|
||||||
${content}
|
${content}
|
||||||
|
</${scriptText}>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,11 +134,11 @@ import "primevue/resources/themes/saga-blue/theme.css";
|
||||||
import "primevue/resources/primevue.min.css";
|
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 Button from "primevue/button";
|
import ${this.name.slice(0, -4)} from "primevue/${this.name.slice(0, -4).toLowerCase()}";
|
||||||
import PrimeVue from "primevue/config";
|
import PrimeVue from "primevue/config";
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
app.use(PrimeVue, { ripple: true });
|
app.use(PrimeVue, { ripple: true });
|
||||||
app.component("Button", Button);
|
app.component("${this.name.slice(0, -4)}", ${this.name.slice(0, -4)});
|
||||||
|
|
||||||
app.mount("#app");
|
app.mount("#app");
|
||||||
`
|
`
|
||||||
|
@ -416,16 +417,11 @@ img.flag {
|
||||||
|
|
||||||
|
|
||||||
if (this.service) {
|
if (this.service) {
|
||||||
_files[`src/service/${this.service}${extension}`] = {
|
_files[`src/service/${this.service}.js`] = {
|
||||||
content: services[this.service]
|
content: services[this.service]
|
||||||
}
|
}
|
||||||
|
|
||||||
extDependencies['axios'] = "^0.19.0";
|
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) {
|
if (this.data) {
|
||||||
|
|
|
@ -1,56 +1,50 @@
|
||||||
const services = {
|
const services = {
|
||||||
'CountryService': `
|
'CountryService': `
|
||||||
import axios from 'axios'
|
import axios from 'axios';
|
||||||
|
|
||||||
export class CountryService {
|
export default class CountryService {
|
||||||
|
|
||||||
getCountries() {
|
getCountries() {
|
||||||
return axios.get('data/countries.json')
|
return axios.get('data/countries.json').then(res => res.data.data);
|
||||||
.then(res => res.data.data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
'CustomerService': `
|
'CustomerService': `
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
export class CustomerService {
|
export default class CustomerService {
|
||||||
|
|
||||||
getCustomersSmall() {
|
getCustomersSmall() {
|
||||||
return axios.get('data/customers-small.json')
|
return axios.get('data/customers-small.json').then(res => res.data.data);
|
||||||
.then(res => res.data.data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getCustomersMedium() {
|
getCustomersMedium() {
|
||||||
return axios.get('data/customers-medium.json')
|
return axios.get('data/customers-medium.json').then(res => res.data.data);
|
||||||
.then(res => res.data.data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getCustomersLarge() {
|
getCustomersLarge() {
|
||||||
return axios.get('data/customers-large.json')
|
return axios.get('data/customers-large.json').then(res => res.data.data);
|
||||||
.then(res => res.data.data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getCustomersXLarge() {
|
getCustomersXLarge() {
|
||||||
return axios.get('data/customers-xlarge.json')
|
return axios.get('data/customers-xlarge.json').then(res => res.data.data);
|
||||||
.then(res => res.data.data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
'EventService': `
|
'EventService': `
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
export class EventService {
|
export default class EventService {
|
||||||
|
|
||||||
getEvents() {
|
getEvents() {
|
||||||
return axios.get('data/events.json')
|
return axios.get('data/events.json').then(res => res.data.data);
|
||||||
.then(res => res.data.data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
'NodeService': `
|
'NodeService': `
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
export class NodeService {
|
export default class NodeService {
|
||||||
|
|
||||||
getTreeTableNodes() {
|
getTreeTableNodes() {
|
||||||
return axios.get('data/treetablenodes.json')
|
return axios.get('data/treetablenodes.json')
|
||||||
|
@ -61,18 +55,18 @@ export class NodeService {
|
||||||
return axios.get('data/treenodes.json')
|
return axios.get('data/treenodes.json')
|
||||||
.then(res => res.data.root);
|
.then(res => res.data.root);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
'PhotoService': `
|
'PhotoService': `
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
export class PhotoService {
|
export default class PhotoService {
|
||||||
|
|
||||||
getImages() {
|
getImages() {
|
||||||
return axios.get('data/photos.json')
|
return axios.get('data/photos.json').then(res => res.data.data);
|
||||||
.then(res => res.data.data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
'ProductService': `
|
'ProductService': `
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
Loading…
Reference in New Issue