添加调试模块

This commit is contained in:
2024-12-22 02:06:54 +08:00
parent b89cef5b7c
commit c9bcd42ada
4 changed files with 46 additions and 3 deletions

25
src/desktop/Debug.vue Normal file
View File

@@ -0,0 +1,25 @@
<template>
<iframe width="100%" height="350" frameborder="0" :src="src"> </iframe>
</template>
<script lang="ts" setup>
import qs from "query-string"
import { onMounted, ref } from "vue"
import { code } from "../composables/code"
const src = ref("")
onMounted(() => {
// const url = "http://localhost:8000"
const url = "https://pythontutor.xuyue.cc"
const base = url + "/iframe-embed.html"
const part1 = qs.stringify({
code: code.value,
codeDivWidth: 300,
})
const part2 =
"&cumulative=false&curInstr=0&heapPrimitives=nevernest&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=true"
const query = part1 + part2
src.value = base + "#" + query
})
</script>