add helper function to get value of baseurl
This commit is contained in:
10
src/Umbraco.Web.UI.Client/src/core/utils/baseUrl.ts
Normal file
10
src/Umbraco.Web.UI.Client/src/core/utils/baseUrl.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export function baseUrl(): string {
|
||||
if (typeof document !== 'undefined') {
|
||||
const baseElems = document.getElementsByTagName('base');
|
||||
if (baseElems.length) {
|
||||
return baseElems[0].href.slice(0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
export * from './baseUrl';
|
||||
export * from './umbraco-path';
|
||||
|
||||
Reference in New Issue
Block a user