Подключаем работу с Vuex

This commit is contained in:
Book Pauk
2019-01-01 21:41:26 +07:00
parent 771cf32ed8
commit 22dab347ea
5 changed files with 75 additions and 18 deletions

View File

@@ -1,12 +1,15 @@
import axios from 'axios';
async function test() {
try {
const response = await axios.post('/api/config', {params: ['version']});
console.log(response);
} catch (error) {
console.error(error.response.data);
}
class Misc {
async getConfig() {
const response = await axios.post('/api/config', {params: ['name', 'version']});
return response.data;
}
}
test();
let misc = null;
if (!misc) {
misc = new Misc();
}
export default misc;