We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30b9483 commit 16b60ccCopy full SHA for 16b60cc
vue3_lab/src/components/HelloWorld.vue
@@ -0,0 +1,33 @@
1
+<script setup lang="ts">
2
+import axios from 'axios';
3
+declare global {
4
+ interface Window {
5
+ editor: {
6
+ getHtml: () => string;
7
+ };
8
+ }
9
+}
10
+// 定义 post 请求方法
11
+const sendPostRequest = async () => {
12
+ try {
13
+ const response = await axios.post('/office/inserthtml', {
14
+ html: window.editor.getHtml()
15
+ });
16
+ console.log('响应数据:', response.data);
17
+ } catch (error) {
18
+ console.error('请求失败:', error);
19
20
+};
21
+</script>
22
+
23
+<template>
24
+ <div class="card">
25
+ <button type="button" @click="sendPostRequest();">post</button>
26
+ </div>
27
+</template>
28
29
+<style scoped>
30
+.read-the-docs {
31
+ color: #888;
32
33
+</style>
0 commit comments