added babel and INCORRECT vue-flag-icon type definitions -> disabled check (js lib instead of ts)

This commit is contained in:
Tobias Kurze
2019-03-12 16:44:28 +01:00
parent 48e8759c31
commit 18f22fdffa
11 changed files with 140 additions and 20 deletions

View File

@@ -3,3 +3,9 @@
<h1>This is an about page</h1>
</div>
</template>
<style lang="scss">
.about {
background: $bg-classroom;
}
</style>

View File

@@ -1,18 +1,48 @@
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
</div>
<div class="home">
<div>
<button v-for="entry in languages" :key="entry.title" @click="changeLocale(entry.language)">
<flag :iso="entry.flag" v-bind:squared="false"/>
{{entry.title}}
</button>
</div>
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src
import {Component, Vue} from 'vue-property-decorator';
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src
import i18n from '@/plugins/i18n';
@Component({
components: {
HelloWorld,
},
})
export default class Home extends Vue {}
@Component({
components: {
HelloWorld,
},
})
export default class Home extends Vue {
public data() {
return {
languages: [
{flag: 'us', language: 'en', title: 'English'},
{flag: 'es', language: 'es', title: 'Español'},
{flag: 'de', language: 'de', title: 'Deutsch'},
],
};
}
public changeLocale(locale: string): void {
i18n.locale = locale;
}
}
</script>
<style>
button {
padding: 15px;
border: 2px solid green;
font-size: 18px;
margin: 15px;
}
</style>