add watcher

This commit is contained in:
wh1te909
2021-08-28 06:48:00 +00:00
parent d4888a7b72
commit ef2984cb2a

View File

@@ -110,7 +110,7 @@
<script>
// composable imports
import { ref, computed } from "vue";
import { ref, computed, watch } from "vue";
import { useQuasar, useDialogPluginComponent } from "quasar";
import { saveScript, editScript, downloadScript } from "@/api/scripts";
import { notifySuccess } from "@/utils/notify";
@@ -175,6 +175,12 @@ export default {
script.value.code = r.code;
});
watch(code, (newValue, oldValue) => {
if (newValue) {
script.value.code = code.value;
}
});
async function submitForm() {
loading.value = true;
let result = "";