gctGenerator/site/.vuepress/components/VersionSelect.vue

39 lines
719 B
Vue
Raw Normal View History

2020-06-27 23:33:20 +02:00
<template>
<SelectComponent
2020-07-10 00:57:16 +02:00
:placeholder="getLabel('generatorconfig.gameversion.placeholder')"
2020-06-28 03:45:44 +02:00
:selectedValue="selectedValue"
2020-06-27 23:33:20 +02:00
:options="options"
:onChange="onChange"
/>
</template>
<script>
2020-07-10 00:57:16 +02:00
// Data
2020-06-28 17:35:18 +02:00
import gameVersions from '../data/gameVersions.json';
2020-06-27 23:33:20 +02:00
2020-07-10 00:57:16 +02:00
// Util
import { translate } from '../i18n/localeHelper';
2020-06-27 23:33:20 +02:00
export default {
props: {
selectedValue: { type: String },
onChange: { type: Function },
},
data() {
return {
2020-07-01 07:26:48 +02:00
options: gameVersions.map((v) => ({
2020-06-27 23:33:20 +02:00
value: v.identifier,
2020-07-10 00:57:16 +02:00
label: `common.${v.identifier}`,
2020-06-27 23:33:20 +02:00
})),
};
},
2020-07-10 00:57:16 +02:00
methods: {
getLabel(key) {
return translate(key, this.$lang);
},
2020-07-10 00:59:26 +02:00
},
2020-06-27 23:33:20 +02:00
};
</script>
<style scoped></style>