This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-side.vue
67 lines (63 loc) · 1.58 KB
/
example-side.vue
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
60
61
62
63
64
65
66
67
<template>
<div class="example-side">
<h1>{{ __getLocale("hello_world") }}</h1>
<example-picker v-bind:parts="pickerParts" />
</div>
</template>
<style scoped>
.example-side {
font: 20px;
}
</style>
<script>
import LocaleMap from "./locale.json";
import ExamplePicker from "./example-picker.vue";
import { logicMixin } from "./logic";
export const ExampleSide = {
name: "example-side",
components: {
"example-picker": ExamplePicker
},
mixins: [logicMixin],
data: function() {
return {
initialsExtra: {}
};
},
computed: {
brand() {
return this.$store.state.brand;
},
model() {
return this.$store.state.model;
},
options() {
return this.$store.state.options;
},
pickerParts() {
return Object.keys(this.options);
}
},
watch: {
model: {
handler: function() {
this.refresh();
}
}
},
methods: {
refresh() {
this.$store.dispatch("refreshInitialsData");
this.onInitialsExtra = this.$bus.bind("personalization", personalize => {
this.initialsExtra = personalize.initialsExtra;
});
},
__getLocale(key) {
let locale = this.$store.state.locale;
locale = LocaleMap[locale] || LocaleMap.en_us;
return locale[key];
}
}
};
export default ExampleSide;
</script>