Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CustomFontSize.vue « Theming « Components « vue « src - github.com/marius-wieschollek/passwords-webextension.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 94140570bd15e4da3cf2232cec9d9425fadb79ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
    <div class="setting">
        <translate tag="label" for="custom-font" say="SettingsCustomFontSize"/>
        <select-field id="custom-font" :options="options" v-model="model"/>
    </div>
</template>

<script>
    import SelectField from '@vue/Components/Form/SelectField';
    import Translate from '@vue/Components/Translate';

    export default {
        components: {Translate, SelectField},

        props: {
            value: {
                default: '11pt'
            }
        },

        data() {
            return {
                model: this.value ? this.value:'11pt'
            };
        },

        mounted() {
            this.model = this.value;
        },

        computed: {
            options() {
                let options = {
                    '8pt' : 'FontSizeVerySmall',
                    '10pt': 'FontSizeSmall',
                    '11pt': 'FontSizeDefault',
                    '12pt': 'FontSizeMedium',
                    '14pt': 'FontSizeLarge',
                    '16pt': 'FontSizeVeryLarge'
                };

                if(!options.hasOwnProperty(this.value)) {
                    options[this.value] = this.value;
                }

                return options;
            }
        },

        watch: {
            value(value) {
                this.model = value;
            },
            model(value) {
                this.$emit('input', value);
            }
        }
    };
</script>