cygnal/src/views/Settings.vue

45 lines
1.3 KiB
Vue
Raw Normal View History

<template>
<v-container fluid class="no-padding">
<v-layout row wrap>
<v-flex xs12 sm4 offset-sm4 class="text-xs-center">
<h2>{{ $t('menu.Settings') }}</h2>
<form>
<v-select
:items="i18nItems"
2018-07-10 14:32:48 +02:00
v-model="locale"
:label="$t('settings.locale')"
required
></v-select>
2018-07-03 19:01:56 +02:00
<v-checkbox
:label="$t('settings.preventSuspend')"
v-model="preventSuspend"
></v-checkbox>
2018-07-11 01:14:54 +02:00
<v-btn role="button" @click="submit">{{ $t('settings.save') }}</v-btn>
</form>
</v-flex>
</v-layout>
</v-container>
</template>
<script>
import { messages } from '@/i18n';
export default {
data() {
return {
i18nItems: Object.keys(messages),
2018-07-10 14:32:48 +02:00
locale: this.$store.state.settings.locale,
preventSuspend: this.$store.state.settings.preventSuspend,
};
},
methods: {
submit() {
2018-07-12 17:48:26 +02:00
this.$store.dispatch('setLocale', { locale: this.locale });
2018-07-10 14:32:48 +02:00
this.$store.dispatch('setSetting', { setting: 'preventSuspend', value: this.preventSuspend });
},
},
};
</script>