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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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