gctGenerator/site/.vuepress/components/VersionSelect.vue
Matteias Collet 79fab84fae minor cleanup
2022-01-16 18:17:07 +00:00

38 lines
719 B
Vue

<template>
<SelectComponent
:placeholder="getLabel('generatorconfig.gameversion.placeholder')"
:selectedValue="selectedValue"
:options="options"
:onChange="onChange"
/>
</template>
<script>
// 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>