Skip to content

Commit 67e3837

Browse files
committed
标线删除撤销
1 parent 6eab494 commit 67e3837

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/editor/annotation.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,22 @@ function handleValueBlur() {
9696
self.value.value = Number(self.value.value);
9797
}
9898
99+
import { Snackbar } from "sober";
99100
function deleteAnnotation() {
100-
emitter.emit("require-full-update", "annotations axis change");
101+
const backup = props.self;
101102
profile.annotations.splice(props.index, 1);
103+
emitter.emit("require-full-update", "annotations axis change");
104+
profile.datum.splice(props.index, 1);
105+
Snackbar.builder({
106+
text: t("editor.delete.success"),
107+
action: {
108+
text: t("editor.delete.undo"),
109+
click: () => {
110+
profile.annotations.splice(props.index, 0, backup);
111+
emitter.emit("require-full-update", "annotations axis change");
112+
},
113+
},
114+
});
102115
}
103116
</script>
104117

@@ -136,6 +149,7 @@ function deleteAnnotation() {
136149
}
137150
.text {
138151
font-size: 16px;
152+
flex-grow: 2;
139153
}
140154
}
141155

0 commit comments

Comments
 (0)