Skip to content

Commit 689b7c6

Browse files
authored
Merge pull request #13 from Linho1219/main
同步主分支
2 parents 894c366 + ad8c5de commit 689b7c6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/editor/data.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ watch(fnType, (newFnType) => {
147147
graphType: newGraphType,
148148
});
149149
});
150+
150151
watch(
151-
() => self.value.graphType,
152+
() => props.self.graphType,
152153
(newGraphType) => {
153154
if (newGraphType === "scatter" && "closed" in self.value)
154155
self.value.closed = false;

src/states.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const useProfile = defineStore("profile", () => {
3333
const importedDatum = importedProfile?.data;
3434
const processedDatum = importedDatum
3535
? importedDatum.map(toPrivateData)
36-
: [toPrivateData({ fn: "x^2" })];
36+
: [toPrivateData({ fn: "x^2", graphType: "polyline" })];
3737

3838
const datum = ref(processedDatum);
3939

@@ -42,7 +42,8 @@ export const useProfile = defineStore("profile", () => {
4242
.filter(({ hidden }) => !(hidden && forExport))
4343
.map((data) => (data.hidden ? getInvisible() : toPublicData(data)));
4444

45-
const addData = () => datum.value.push(toPrivateData({}));
45+
const addData = () =>
46+
datum.value.push(toPrivateData({ graphType: "polyline" }));
4647

4748
const importedAnnotations = importedProfile?.annotations;
4849
const processedAnnotations = importedAnnotations

0 commit comments

Comments
 (0)