gctGenerator/site/.vuepress/components/VersionSelect.vue
Matteias Collet 2c3f65bd83 cleanup
2020-07-10 00:59:26 +02:00

41 lines
783 B
Vue

<template>
<SelectComponent
:placeholder="getLabel('generatorconfig.gameversion.placeholder')"
:selectedValue="selectedValue"
:options="options"
:onChange="onChange"
/>
</template>
<script>
// Components
import SelectComponent from './SelectComponent';
// Data
import gameVersions from '../data/gameVersions.json';
// Util
import { translate } from '../i18n/localeHelper';
export default {
props: {
selectedValue: { type: String },
onChange: { type: Function },
},
data() {
return {
options: gameVersions.map((v) => ({
value: v.identifier,
label: `common.${v.identifier}`,
})),
};
},
methods: {
getLabel(key) {
return translate(key, this.$lang);
},
},
};
</script>
<style scoped></style>