Mẫu cấu hình đối tượng danh mục trò chơi hiển thị tĩnh bằng JavaScript và JSON.
JavaScript
// Cấu hình danh mục trò chơi hiển thị cục bộ
const localGameConfig = {
brand: '789WIN',
locale: 'vi-VN',
defaultGameId: '003',
featuredGames: [
{ id: '003', name: 'Fortune Gods', guidePath: '/play-guides/game-003/' },
{ id: '030', name: 'Symbols Of Egypt', guidePath: '/play-guides/game-030/' },
{ id: '114', name: 'Rooster Rbl', guidePath: '/play-guides/game-114/' }
]
};
function getGameInfo(id) {
return localGameConfig.featuredGames.find(item => item.id === id) || null;
}
JSON
{
"brand": "789WIN",
"locale": "vi-VN",
"defaultGameId": "003",
"featuredGames": [
{
"id": "003",
"name": "Fortune Gods",
"guidePath": "/play-guides/game-003/"
},
{
"id": "030",
"name": "Symbols Of Egypt",
"guidePath": "/play-guides/game-030/"
},
{
"id": "114",
"name": "Rooster Rbl",
"guidePath": "/play-guides/game-114/"
}
]
}