From 67faa25e8b7ab678ea952351d764633aec52215c Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 26 Aug 2022 00:41:08 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Search/Search.vue | 5 +-- client/components/share/DivBtn.vue | 49 +++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index 5150bf9..3692567 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -32,7 +32,7 @@ - +
- + +
diff --git a/client/components/share/DivBtn.vue b/client/components/share/DivBtn.vue index 54c7f57..76b44bd 100644 --- a/client/components/share/DivBtn.vue +++ b/client/components/share/DivBtn.vue @@ -1,7 +1,9 @@ @@ -9,7 +11,7 @@ //----------------------------------------------------------------------------- import vueComponent from '../vueComponent.js'; -//import * as utils from '../../share/utils'; +import * as utils from '../../share/utils'; const componentOptions = { watch: { @@ -25,8 +27,11 @@ class DivBtn { icon: { type: String, default: '' }, iconSize: { type: Number, default: 14 }, round: { type: Boolean }, + pad: { type: Number, default: 0 }, }; + pressed = false; + created() { } @@ -35,10 +40,22 @@ class DivBtn { } updateSizes() { - this.$refs.btn.style.width = `${this.size}px`; - this.$refs.btn.style.height = `${this.size}px`; + const style = this.$refs.btn.style; + style.minWidth = `${this.size}px`; + style.height = `${this.size}px`; + if (this.pad) { + style.paddingLeft = `${this.pad}px`; + style.paddingRight = `${this.pad + 5}px`; + } + if (this.round) - this.$refs.btn.style.borderRadius = `${this.size}px`; + style.borderRadius = `${this.size}px`; + } + + async clickEffect() { + this.pressed = true; + await utils.sleep(100); + this.pressed = false; } } @@ -47,8 +64,22 @@ export default vueComponent(DivBtn); \ No newline at end of file