mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
Removed code duplication and get baseURL from nuxt runtime
This commit is contained in:
parent
0c840beded
commit
06df25c7cc
34 changed files with 215 additions and 244 deletions
|
@ -1,8 +1,8 @@
|
|||
const baseUrl = process.env.NODE_ENV === 'production' ? '/primevue-nuxt/' : '/';
|
||||
|
||||
export default class CountryService {
|
||||
getCountries() {
|
||||
return fetch(baseUrl + 'demo/data/countries.json')
|
||||
const runtimeConfig = useRuntimeConfig();
|
||||
|
||||
return fetch(runtimeConfig.public.contextPath + 'demo/data/countries.json')
|
||||
.then((res) => res.json())
|
||||
.then((d) => d.data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue