mirror of
https://github.com/romancm/gamebrary
synced 2024-12-24 01:53:07 +00:00
43 lines
892 B
Vue
43 lines
892 B
Vue
<template lang="html">
|
|
<b-form-checkbox-group
|
|
v-model="selectedPlatforms"
|
|
:options="options"
|
|
switches
|
|
stacked
|
|
@input="$emit('change', selectedPlatforms)"
|
|
/>
|
|
</template>
|
|
|
|
<script>
|
|
import { mapState, mapGetters } from 'vuex';
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
selectedPlatforms: null,
|
|
};
|
|
},
|
|
|
|
computed: {
|
|
...mapState(['board']),
|
|
...mapGetters(['platformNames']),
|
|
|
|
options() {
|
|
return this.board.platforms.map((value) => {
|
|
const text = this.platformNames[value] && this.platformNames[value].name
|
|
? `${this.platformNames[value].name}`
|
|
: `N/A Missing label for platform ${value}`;
|
|
|
|
return { text, value };
|
|
});
|
|
},
|
|
},
|
|
|
|
mounted() {
|
|
this.selectedPlatforms = JSON.parse(JSON.stringify(this.board.platforms));
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" rel="stylesheet/scss" scoped>
|
|
</style>
|