refactor(modules/web): Mirgrat to typescript; fix bugs
This commit is contained in:
1 parent
b95deeb607
commit
7984c45cb9
81 files changed
+6396
-3166
No files matched your search
@@ -9,30 +9,30 @@
|
||||
style="margin-bottom: 4px"
|
||||
></el-input>
|
||||
</template>
|
||||
<script setup>
|
||||
import { useSourceStore } from "@/store";
|
||||
<script setup lang="ts">
|
||||
import { useSourceStore } from '@/store'
|
||||
|
||||
const store = useSourceStore();
|
||||
const sourceString = ref("");
|
||||
const update = async (string) => {
|
||||
const store = useSourceStore()
|
||||
const sourceString = ref('')
|
||||
const update = async (string: string) => {
|
||||
try {
|
||||
store.changeEditTabSource(JSON.parse(string));
|
||||
store.changeEditTabSource(JSON.parse(string))
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: "粘贴的源格式错误",
|
||||
type: "error",
|
||||
});
|
||||
message: '粘贴的源格式错误',
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
watchEffect(async () => {
|
||||
let source = store.editTabSource;
|
||||
const source = store.editTabSource
|
||||
if (Object.keys(source).length > 0) {
|
||||
sourceString.value = JSON.stringify(source, null, 4);
|
||||
sourceString.value = JSON.stringify(source, null, 4)
|
||||
} else {
|
||||
sourceString.value = "";
|
||||
sourceString.value = ''
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
:deep(.el-input) {
|
||||
|
||||
Reference in new issue
Block a user