Update LiveEditor
parent
478ef5b991
commit
b6cb589f81
|
@ -511,23 +511,33 @@ img.flag {
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.service && this.data) {
|
if (this.service) {
|
||||||
const dataArr = this.data.split(',');
|
const dataArr = this.data ? this.data.split(',') : null;
|
||||||
|
|
||||||
dataArr.forEach(el => {
|
if(dataArr) {
|
||||||
_files[`public/data/${el}.json`] = {
|
dataArr.forEach(el => {
|
||||||
content: data[el]
|
_files[`public/data/${el}.json`] = {
|
||||||
};
|
content: data[el]
|
||||||
|
};
|
||||||
|
|
||||||
_files[`src/service/${this.service}.js`] = {
|
_files[`src/service/${this.service}.js`] = {
|
||||||
// content: services[this.service]
|
content: `import axios from 'axios';
|
||||||
content: `import axios from 'axios';
|
|
||||||
import data from '../../public/data/${el}.json';
|
import data from '../../public/data/${el}.json';
|
||||||
|
|
||||||
${services[this.service]}
|
${services[this.service]}
|
||||||
`
|
`
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
_files[`src/service/${this.service}.js`] = {
|
||||||
|
content: `import axios from 'axios';
|
||||||
|
|
||||||
|
${services[this.service]}
|
||||||
|
`
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extDependencies['axios'] = "^0.19.0";
|
extDependencies['axios'] = "^0.19.0";
|
||||||
|
|
|
@ -25,6 +25,10 @@ export default class CustomerService {
|
||||||
getCustomersXLarge() {
|
getCustomersXLarge() {
|
||||||
return axios.get(data).then(res => res.config.url.data);
|
return axios.get(data).then(res => res.config.url.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getCustomers(params) {
|
||||||
|
return axios.get('https://www.primefaces.org/data/customers', { params }).then(res => res.data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
'EventService': `
|
'EventService': `
|
||||||
|
|
Loading…
Reference in New Issue