Browse Source

bind something

night-cherry 1 month ago
parent
commit
c0e9d4188f
2 changed files with 4 additions and 1 deletions
  1. 1 0
      index.html
  2. 3 1
      index.js

+ 1 - 0
index.html

@@ -41,6 +41,7 @@
 		<label @click="changelang('en')">english</label>
 		<hr/>
 		<button @click="interface_web()">connect to tomcat</button>
+		<h4>{{tomcat_res}}</h4>
 		<!--<input type="button" text="中文" @click="changelang('zh')"/>
 		<input type="button" text="english" @click="changelang('en')"/>-->
 		<p>

+ 3 - 1
index.js

@@ -71,7 +71,8 @@ const app=createApp({
           value: 'ja',
           label: 'にほんご',
         },
-      ]
+      ],
+      tomcat_res:null,
     }
   },
   methods:{
@@ -90,6 +91,7 @@ const app=createApp({
     request.onload=function(){
       console.log("parse tomcat server string");
       const res=JSON.parse(request.responseText);
+      this.tomcat_res=res;
       console.log("res:"+res);
     };
     request.open("POST","http://ancientapes.cc:8080/mineluxuries/book");