import { Options, Vue } from 'vue-class-component'; @Options({}) export default class APIExtendableLanguage extends Vue { isLoading = true; images: any; language = ''; languages: any; random: any; async fetchImages(): Promise { fetch(`http://api.senpy.club/api/v1/language?lang=${this.language}`, { method: 'GET', }) .then((response) => response.json()) .then((response) => { this.images = response; this.isLoading = false; }); } async fetchLanguages(): Promise { fetch('http://api.senpy.club/api/v1/languages', { method: 'GET', }) .then((response) => response.json()) .then((response) => { this.languages = response; this.isLoading = false; }); } async fetchRandom(): Promise { fetch('http://api.senpy.club/api/v1/random', { method: 'GET', }) .then((response) => response.json()) .then((response) => { this.random = response; this.isLoading = false; }); } }