chore: Aggiunto type hinting alla proprietà page

This commit is contained in:
Maicol Battistini 2021-08-06 12:32:43 +02:00
parent ae496dab97
commit 4db4058d55
No known key found for this signature in database
GPG Key ID: 4FDB0F87CDB1D34A
1 changed files with 9 additions and 1 deletions

View File

@ -6,7 +6,15 @@ import Component from './Component';
* @abstract
*/
export default class Page extends Component {
page = JSON.parse($('#app').attr('data-page'));
page: {
component: string,
locale: string,
props: Object,
translations: Object,
url: string,
version: string,
...
} = JSON.parse($('#app').attr('data-page'));
__(key: string, replace: Object = {}) {
let translation = this.page.translations[key]