forked from Linho1219/function-plot-GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.vue
More file actions
127 lines (121 loc) · 3.46 KB
/
options.vue
File metadata and controls
127 lines (121 loc) · 3.46 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
<s-scroll-view>
<div id="options">
<!-- global -->
<s-divider>{{ t("options.global") }}</s-divider>
<div class="option">
<span class="label">{{ t("options.grid") }}</span>
<s-switch
v-model.lazy="profile.options.grid"
type="checkbox"
></s-switch>
</div>
<div class="option">
<span class="label">{{ t("options.title") }}</span>
<s-text-field
:label="t('options.title')"
v-model="profile.options.title"
></s-text-field>
</div>
<!-- xAxis -->
<s-divider>{{ t("options.horizontal") }}</s-divider>
<div class="option">
<span class="label">{{ t("options.axis.reverse") }}</span>
<s-switch
v-model.lazy="profile.options.xAxis.invert"
type="checkbox"
></s-switch>
</div>
<div class="option">
<span class="label">{{ t("options.axis.grow") }}</span>
<s-segmented-button v-model.lazy="profile.options.xAxis.type">
<s-segmented-button-item value="linear">{{
t("options.axis.linear")
}}</s-segmented-button-item>
<s-segmented-button-item value="log">
{{ t("options.axis.log") }}
</s-segmented-button-item>
</s-segmented-button>
</div>
<div class="option">
<span class="label">{{ t("options.axis.caption") }}</span>
<s-text-field
:label="t('options.axis.caption')"
v-model="profile.options.xAxis.label"
></s-text-field>
</div>
<!-- yAxis -->
<s-divider>{{ t("options.vertical") }}</s-divider>
<div class="option">
<span class="label">{{ t("options.axis.reverse") }}</span>
<s-switch
v-model.lazy="profile.options.yAxis.invert"
type="checkbox"
></s-switch>
</div>
<div class="option">
<span class="label">{{ t("options.axis.grow") }}</span>
<s-segmented-button v-model.lazy="profile.options.yAxis.type">
<s-segmented-button-item value="linear">{{
t("options.axis.linear")
}}</s-segmented-button-item>
<s-segmented-button-item value="log">
{{ t("options.axis.log") }}
</s-segmented-button-item>
</s-segmented-button>
</div>
<div class="option">
<span class="label">{{ t("options.axis.caption") }}</span>
<s-text-field
:label="t('options.axis.caption')"
v-model="profile.options.yAxis.label"
></s-text-field>
</div>
</div>
</s-scroll-view>
</template>
<script setup lang="ts">
import { useI18n } from "vue-i18n";
import { I18nSchema } from "@/i18n";
const { t } = useI18n<{ message: I18nSchema }>();
import { useProfile } from "@/states";
const profile = useProfile();
import { watch } from "vue";
import emitter from "@/mitt";
watch(
[
() => profile.options.xAxis.type,
() => profile.options.yAxis.type,
() => profile.options.xAxis.invert,
() => profile.options.yAxis.invert,
],
() => {
emitter.emit("require-full-update", "axis type change");
}
);
</script>
<style>
#options {
display: flex;
flex-direction: column;
gap: 10px;
padding-top: 5px;
}
#options s-divider {
font-size: 0.8em;
margin: 5px 15px;
}
.option {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
margin: 0 30px;
}
.option span {
line-height: 2em;
}
.option s-text-field {
max-width: 100%;
}
</style>