fix: cmd/ctrl+s to save workflow
This commit is contained in:
parent
654c941635
commit
13e5031c3c
1 changed files with 10 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import ActionNode from "./components/ActionNode.vue";
|
|||
import ConnectionLine from "./components/ConnectionLine.vue";
|
||||
import { useStore } from "./store";
|
||||
import { nextTick, onMounted, watch } from "vue";
|
||||
import { useMagicKeys, whenever } from "@vueuse/core";
|
||||
|
||||
let store = useStore();
|
||||
let {
|
||||
|
|
@ -28,6 +29,15 @@ let {
|
|||
vueFlowRef
|
||||
} = useVueFlow();
|
||||
|
||||
// cmd/ctrl + s to save the form
|
||||
const { meta_s, ctrl_s } = useMagicKeys();
|
||||
whenever(
|
||||
() => meta_s.value || ctrl_s.value,
|
||||
() => {
|
||||
store.save_changes();
|
||||
}
|
||||
);
|
||||
|
||||
onNodeDragStop(() => {
|
||||
nextTick(() => store.ref_history.commit());
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue