Skip to content

Commit 84fec3e

Browse files
Merge pull request #4 from esto-openscan/main
fix build error
2 parents 4482446 + 6ff1297 commit 84fec3e

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openscan3-client",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"apiVersion": "0.6.0",
55
"description": "Frontend client for OpenScan3 firmware devices",
66
"productName": "OpenScan3",

app/src/boot/axios.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { boot } from 'quasar/wrappers';
22
import axios, { AxiosInstance } from 'axios';
3-
import { api } from '../api';
3+
import { apiClient } from 'src/services/apiClient';
4+
import { useApiConfigStore } from 'src/stores/apiConfig';
45

56
declare module '@vue/runtime-core' {
67
interface ComponentCustomProperties {
78
$axios: AxiosInstance;
9+
$apiClient: typeof apiClient;
10+
$apiConfig: ReturnType<typeof useApiConfigStore>;
811
}
912
}
1013

@@ -16,13 +19,14 @@ declare module '@vue/runtime-core' {
1619
// for each client)
1720

1821
export default boot(({ app }) => {
19-
// for use inside Vue files (Options API) through this.$axios and this.$api
22+
// for use inside Vue files (Options API) through this.$axios and related helpers
23+
24+
const apiConfigStore = useApiConfigStore();
2025

2126
app.config.globalProperties.$axios = axios;
2227
// ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form)
2328
// so you won't necessarily have to import axios in each vue file
24-
25-
app.config.globalProperties.$api = api;
26-
// ^ ^ ^ this will allow you to use this.$api (for Vue Options API form)
27-
// so you can easily perform requests against your app's API
29+
app.config.globalProperties.$apiClient = apiClient;
30+
app.config.globalProperties.$apiConfig = apiConfigStore;
31+
// ^ ^ ^ expose generated API client and config store to Options API components
2832
});

0 commit comments

Comments
 (0)