Options for custom FhcApiFactory

This commit is contained in:
cgfhtw
2024-03-06 16:52:42 +01:00
parent 1dcece8563
commit 1344ab987e
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -286,7 +286,9 @@ export default {
}
}
app.config.globalProperties.$fhcApi.factory = new FhcApiFactoryWrapper(FhcApiFactory);
const mergedFhcApiFactory = options?.factory ? {...FhcApiFactory, ...options.factory} : FhcApiFactory;
app.config.globalProperties.$fhcApi.factory = new FhcApiFactoryWrapper(mergedFhcApiFactory);
}
};
+1 -1
View File
@@ -62,7 +62,7 @@ const phrasen = {
export default {
install(app, options) {
app.use(FhcApi);
app.use(FhcApi, options?.fhcApi || undefined);
app.config.globalProperties.$p = {
t: phrasen.t,
loadCategory: cat => phrasen.loadCategory.call(app, cat),