aboutsummaryrefslogtreecommitdiffstats
path: root/apps/accessibility/src/components/itemPreview.vue
blob: 7f4e17b16f1b72fe40b7ad15e746c225ef77f629 (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
<template>
	<div :class="{preview: true}">
		<div class="preview-image" :style="{backgroundImage: 'url(' + preview.img + ')'}"></div>
		<div class="preview-description">
			<h3>{{preview.title}}</h3>
			<p>{{preview.text}}</p>
			<input type="checkbox" class="checkbox" :id="'accessibility-' + preview.id" v-model="checked" />
			<label :for="'accessibility-' + preview.id">{{t('accessibility', 'Enable')}} {{preview.title.toLowerCase()}}</label>
		</div>
	</div>
</template>

<script>
export default {
	name: 'itemPreview',
	props: ['preview', 'selected'],
	computed: {
		checked: {
			get() {
				return this.selected === this.preview.id;
			},
			set(checked) {
				this.$emit('select', checked ? this.preview.id : false,	this.selected);
			}
		}
    },
};
</script>