baseUrl added

pull/3420/head
Tuğçe Küçükoğlu 2022-12-09 16:41:56 +03:00
parent 3e6476c735
commit 4364c463c0
7 changed files with 28 additions and 14 deletions

View File

@ -4,7 +4,7 @@
<i class="pi pi-bars"></i>
</a>
<div v-tooltip.bottom="$appState.theme" class="app-theme">
<img :src="'/demo/images/themes/' + logoMap[$appState.theme]" />
<img :src="baseUrl + 'demo/images/themes/' + logoMap[$appState.theme]" />
</div>
<ul ref="topbarMenu" class="topbar-menu">
<li class="topbar-submenu">
@ -299,7 +299,8 @@ export default {
'lara-light-purple': 'lara-light-purple.png',
'lara-light-teal': 'lara-light-teal.png',
'lara-light-blue': 'lara-light-blue.png'
}
},
baseUrl: '/'
};
},
watch: {
@ -311,6 +312,7 @@ export default {
container: null,
mounted() {
this.bindScrollListener();
this.baseUrl = process.dev ? '/' : '/primevue/nuxt';
},
beforeUnmount() {
if (this.scrollListener) {

View File

@ -1,6 +1,8 @@
const baseUrl = process.env.NODE_ENV === 'production' ? '/primevue-nuxt/' : '/';
export default class CountryService {
getCountries() {
return fetch('demo/data/countries.json')
return fetch(baseUrl + 'demo/data/countries.json')
.then((res) => res.json())
.then((d) => d.data);
}

View File

@ -1,24 +1,26 @@
const baseUrl = process.env.NODE_ENV === 'production' ? '/primevue-nuxt/' : '/';
export default class CustomerService {
getCustomersSmall() {
return fetch('/demo/data/customers-small.json')
return fetch(baseUrl + 'demo/data/customers-small.json')
.then((res) => res.json())
.then((d) => d.data);
}
getCustomersMedium() {
return fetch('/demo/data/customers-medium.json')
return fetch(baseUrl + 'demo/data/customers-medium.json')
.then((res) => res.json())
.then((d) => d.data);
}
getCustomersLarge() {
return fetch('/demo/data/customers-large.json')
return fetch(baseUrl + 'demo/data/customers-large.json')
.then((res) => res.json())
.then((d) => d.data);
}
getCustomersXLarge() {
return fetch('/demo/data/customers-xlarge.json')
return fetch(baseUrl + 'demo/data/customers-xlarge.json')
.then((res) => res.json())
.then((d) => d.data);
}

View File

@ -1,6 +1,8 @@
const baseUrl = process.env.NODE_ENV === 'production' ? '/primevue-nuxt/' : '/';
export default class EventService {
getEvents() {
return fetch('demo/data/events.json')
return fetch(baseUrl + 'demo/data/events.json')
.then((res) => res.json())
.then((d) => d.data);
}

View File

@ -1,12 +1,14 @@
const baseUrl = process.env.NODE_ENV === 'production' ? '/primevue-nuxt/' : '/';
export default class NodeService {
getTreeTableNodes() {
return fetch('/demo/data/treetablenodes.json')
return fetch(baseUrl + 'demo/data/treetablenodes.json')
.then((res) => res.json())
.then((d) => d.root);
}
getTreeNodes() {
return fetch('/demo/data/treenodes.json')
return fetch(baseUrl + 'demo/data/treenodes.json')
.then((res) => res.json())
.then((d) => d.root);
}

View File

@ -1,6 +1,8 @@
const baseUrl = process.env.NODE_ENV === 'production' ? '/primevue-nuxt/' : '/';
export default class PhotoService {
getImages() {
return fetch('/demo/data/photos.json')
return fetch(baseUrl + 'demo/data/photos.json')
.then((res) => res.json())
.then((d) => d.data);
}

View File

@ -1,18 +1,20 @@
const baseUrl = process.env.NODE_ENV === 'production' ? '/primevue-nuxt/' : '/';
export default class ProductService {
getProductsSmall() {
return fetch('/demo/data/products-small.json')
return fetch(baseUrl + 'demo/data/products-small.json')
.then((res) => res.json())
.then((d) => d.data);
}
getProducts() {
return fetch('/demo/data/products-small.json')
return fetch(baseUrl + 'demo/data/products-small.json')
.then((res) => res.json())
.then((d) => d.data);
}
getProductsWithOrdersSmall() {
return fetch('/demo/data/products-small.json')
return fetch(baseUrl + 'demo/data/products-small.json')
.then((res) => res.json())
.then((d) => d.data);
}