#53 Add loading when run the api request for button

Merged
rogerluo410 merged 1 commits from feat/add_try_page into master 1 year ago
  1. +5
    -4
      pages/tryit/index.vue

+ 5
- 4
pages/tryit/index.vue View File

@@ -14,13 +14,14 @@
</div>
</a-row>

<button
<a-button
:disabled="!enableTryit()"
class="run-btn"
:loading="loading"
@click="submitRequest"
>
运行 ❯
</button>
</a-button>
</div>
</div>

@@ -137,10 +138,11 @@ export default {
this.response_status = res.status
} catch (error) {
if (error.response) {
this.loading = false
this.jsonResultCode = JSON.stringify(error.response.data)
this.response_status = error.response.status
}

this.loading = false
}
},
},
@@ -283,7 +285,6 @@ textarea {
background-color: #0277bd;
border-radius: 10px;
box-shadow: 0px 21px 11px -10px rgba(0, 0, 0, 0.2);
padding: 10px;
margin-bottom: 3px;
}



Loading…
Cancel
Save