From 85d4c936130a634972f5e2a70668135d10d6e6b8 Mon Sep 17 00:00:00 2001 From: AceDataCloud Date: Sun, 29 Jan 2023 14:39:06 +0800 Subject: [PATCH] update api result style --- src/components/api/Form.vue | 1 + src/components/api/Result.vue | 93 ++++++++++++++++++++--------------- 2 files changed, 53 insertions(+), 41 deletions(-) diff --git a/src/components/api/Form.vue b/src/components/api/Form.vue index d4b6a6d6..46c6563b 100644 --- a/src/components/api/Form.vue +++ b/src/components/api/Form.vue @@ -37,6 +37,7 @@ v-model="value[itemKey?.toString()]" :placeholder="$t('common.title.placeholderOfInput')" class="inline-block w-4/5" + @focus="$emit('refresh-applications')" /> diff --git a/src/components/api/Result.vue b/src/components/api/Result.vue index 06b766d1..f1c0027c 100644 --- a/src/components/api/Result.vue +++ b/src/components/api/Result.vue @@ -16,8 +16,8 @@

{{ $t('api.entity.responseHeaders') }}

-
-
+
+
{{ itemKey }} {{ item?.type }} @@ -30,13 +30,15 @@

{{ $t('api.entity.responseBody') }}

-
-
- {{ itemKey }} - {{ item?.type }} -
-
- {{ item?.title }} +
+
+
+ {{ itemKey }} + {{ item?.type }} +
+
+ {{ item?.title }} +
@@ -124,40 +126,49 @@ export default defineComponent({ .item-body { padding: 15px; .body, - .headers { - .property { - padding: 10px; - border-right: 1px solid rgba(0, 0, 0, 0.1); - border-left: 1px solid rgba(0, 0, 0, 0.1); + .headers, + .example { + .title { + font-size: 12px; + font-weight: bold; + margin-bottom: 10px; + } + .properties { + margin-bottom: 10px; + .property { + padding: 10px; + border-right: 1px solid rgba(0, 0, 0, 0.1); + border-left: 1px solid rgba(0, 0, 0, 0.1); - &:first-of-type { - border-top: 1px solid rgba(0, 0, 0, 0.1); - border-top-left-radius: 10px; - border-top-right-radius: 10px; - } - - &:not(:first-of-type):not(:last-of-type) { - border-top: 1px solid rgba(0, 0, 0, 0.1); - } - - &:last-of-type { - border-top: 1px solid rgba(0, 0, 0, 0.1); - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - border-bottom-left-radius: 10px; - border-bottom-right-radius: 10px; - } - .info { - .key { - font-size: 14px; - font-weight: bold; - display: inline-block; - padding: 3px; - padding-left: 0; + &:first-of-type { + border-top: 1px solid rgba(0, 0, 0, 0.1); + border-top-left-radius: 10px; + border-top-right-radius: 10px; } - .type { - font-size: 14px; - display: inline-block; - padding: 3px; + + &:not(:first-of-type):not(:last-of-type) { + border-top: 1px solid rgba(0, 0, 0, 0.1); + } + + &:last-of-type { + border-top: 1px solid rgba(0, 0, 0, 0.1); + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + border-bottom-left-radius: 10px; + border-bottom-right-radius: 10px; + } + .info { + .key { + font-size: 14px; + font-weight: bold; + display: inline-block; + padding: 3px; + padding-left: 0; + } + .type { + font-size: 14px; + display: inline-block; + padding: 3px; + } } } }