From 147e0dc3e0d9274738f2b4abb6bcc988fb79a554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B3=B0?= Date: Sat, 16 Mar 2019 21:32:37 +0800 Subject: [PATCH] boxed don`t show more --- lib/json-viewer.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/json-viewer.vue b/lib/json-viewer.vue index 7acb5c7..2c22f4a 100644 --- a/lib/json-viewer.vue +++ b/lib/json-viewer.vue @@ -13,7 +13,7 @@
@@ -88,8 +88,10 @@ export default { } }, mounted: function () { - this.onResized() - this.$el.addEventListener("resized", this.onResized, true) + if (this.boxed && this.$refs.jsonBox) { + this.onResized() + this.$refs.jsonBox.$el.addEventListener("resized", this.onResized, true) + } }, methods: { onResized () { @@ -212,12 +214,15 @@ export default { } .jv-code { - max-height: 300px; overflow: hidden; padding: 20px; + &.boxed { + max-height: 300px; + } + &.open { - max-height: initial; + max-height: initial !important; overflow: visible; overflow-x: auto; padding-bottom: 45px;