From 2eb0ac21d6a73769c7547769c1b315edb2c74b5f Mon Sep 17 00:00:00 2001 From: Qing Date: Mon, 24 Jul 2023 14:06:51 +0800 Subject: [PATCH] Add request method --- src/views/HomeView.vue | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index e60cf41..8c12579 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -6,27 +6,34 @@
博客 - 源码 + 源码
-
+
+
+ + get + post + +
+
- 陕ICP备2023001488号 | 陕公网安备 61072902000127号 + Qing | 陕ICP备2023001488号 | 陕公网安备 61072902000127号
@@ -48,15 +55,16 @@ export default { return{ url:null, jsonData:null, + radio:2, } }, methods:{ getJson(){ - console.log(this.url); + console.log(this.radio) if(this.url!==null){ var that=this; axios({ - method: 'post', + method: this.radio===2?'post':'get', // 请求的地址 url: this.url, }).then( (res)=> { @@ -73,6 +81,9 @@ export default { return false; } + }, + radioChange(){ + this.getJson(); } } }