bms-shared-components 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,6 +43,8 @@ app.mount("#app");
43
43
 
44
44
  ### С настройкой API и Pinia
45
45
 
46
+ При использовании плагина по умолчанию (`BmsSharedComponents`) поддерживаются `apiConfig` и `axiosConfig`:
47
+
46
48
  ```js
47
49
  import { createApp } from "vue";
48
50
  import { createPinia } from "pinia";
@@ -58,13 +60,15 @@ app.use(BmsSharedComponents, {
58
60
  baseURL: "https://api.example.com",
59
61
  token: "your-auth-token",
60
62
  },
61
- // или axiosConfig (рекомендуется):
63
+ // или axiosConfig:
62
64
  // axiosConfig: { baseURL: "...", headers: { Authorization: "..." } },
63
65
  });
64
66
  app.mount("#app");
65
67
  ```
66
68
 
67
- ### Через createBmsComponentsPlugin
69
+ ### createBmsComponentsPlugin
70
+
71
+ Плагин принимает `pinia` и `axiosInstance` (конфиг для `setupAxios`):
68
72
 
69
73
  ```js
70
74
  import { createApp } from "vue";
@@ -76,8 +80,12 @@ const pinia = createPinia();
76
80
  const app = createApp(App);
77
81
  app.use(createBmsComponentsPlugin({
78
82
  pinia,
79
- baseURL: "https://api.example.com",
80
- token: "your-jwt-token",
83
+ axiosInstance: {
84
+ baseURL: "https://api.example.com",
85
+ headers: { Authorization: "Bearer your-jwt-token" },
86
+ },
81
87
  }));
82
88
  app.mount("#app");
83
89
  ```
90
+
91
+ Доступны глобально: `$setupAxios`, `$updateAxiosToken`.