modules 添加web

This commit is contained in:
Xwite
2023-04-07 20:28:21 +08:00
parent ed14659aa6
commit 95f53948f1
88 changed files with 5784 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<template>
<el-input
v-model="sourceString"
type="textarea"
placeholder="这里输出序列化的JSON数据,可直接导入'阅读'APP"
rows="30"
@change="update"
style="margin-bottom: 4px"
></el-input>
</template>
<script setup>
import { useSourceStore } from "@/store";
const store = useSourceStore();
const sourceString = ref("");
const update = async (string) => {
try {
store.changeEditTabSource(JSON.parse(string));
} catch {
ElMessage({
message: "粘贴的源格式错误",
type: "error",
});
}
};
watchEffect(async () => {
let source = store.editTabSource;
if (Object.keys(source).length > 0) {
sourceString.value = JSON.stringify(source, null, 4);
} else {
sourceString.value = "";
}
});
</script>
<style>
.el-input {
width: 100%;
}
</style>