mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-11 01:42:34 +00:00
18 lines
424 B
JavaScript
18 lines
424 B
JavaScript
let icons = [];
|
|
let selectedIcon = null;
|
|
|
|
export const IconService = {
|
|
getIcons() {
|
|
return fetch('/demo/data/icons.json', { headers: { 'Cache-Control': 'no-cache' } })
|
|
.then((res) => res.json())
|
|
.then((d) => d.icons);
|
|
},
|
|
|
|
getIcon(id) {
|
|
if (icons) {
|
|
selectedIcon = icons.find((x) => x.properties.id === id);
|
|
|
|
return selectedIcon;
|
|
}
|
|
}
|
|
};
|