From 98fba09b11398cf98a9a876a53f15ed8d606e43c Mon Sep 17 00:00:00 2001 From: vincenttgao Date: Tue, 30 May 2023 11:20:48 +0800 Subject: [PATCH 1/6] =?UTF-8?q?bugfix(sideslide):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E5=AE=BD=E5=BA=A6=E4=BB=85=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=95=B0=E5=AD=97=E7=9A=84=E9=97=AE=E9=A2=98=20#399?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/sideslider/sideslider.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/sideslider/sideslider.vue b/src/components/sideslider/sideslider.vue index 6ba64db..83af563 100644 --- a/src/components/sideslider/sideslider.vue +++ b/src/components/sideslider/sideslider.vue @@ -29,7 +29,7 @@ diff --git a/example/components/button/readme.md b/example/components/button/readme.md index 973ed6d..2e8799f 100644 --- a/example/components/button/readme.md +++ b/example/components/button/readme.md @@ -315,6 +315,9 @@ 反色按钮 + + 反色按钮 + + + diff --git a/package.json b/package.json index 99acae1..aeda918 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bk-magic-vue", - "version": "2.5.6-beta.3", + "version": "2.5.6", "description": "基于蓝鲸 Magicbox 和 Vue 的前端组件库", "main": "dist/bk-magic-vue.min.js", "files": [ diff --git a/single.html b/single.html index 1a017aa..038e8d2 100644 --- a/single.html +++ b/single.html @@ -78,7 +78,7 @@ } - + @@ -263,7 +263,6 @@ bkMagicVue.locale.use(bkMagicVue.lang['enUS']) - Vue.mixin(bkMagicVue.locale.mixin) const remoteLen = 50 diff --git a/src/components/table/table-layout.js b/src/components/table/table-layout.js index d96e065..086fabc 100644 --- a/src/components/table/table-layout.js +++ b/src/components/table/table-layout.js @@ -131,16 +131,21 @@ class TableLayout { ) { return Vue.nextTick(() => this.updateElsHeight()) } - const tableHeight = (this.tableHeight = this.table.$el.offsetHeight - this.paginationHeight) - const footerHeight = (this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0) - this.bodyHeight = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0) - this.fixedBodyHeight = this.scrollX ? this.bodyHeight - this.gutterWidth : this.bodyHeight - - const noData = !this.table.data || this.table.data.length === 0 - this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight - this.syncRowHeight() - this.updateScrollY() - this.notifyObservers('scrollable') + + // setTimeout 0 for https://github.com/TencentBlueKing/bkui-vue2/issues/387 + setTimeout(() => { + const tableHeight = (this.tableHeight = this.table.$el.offsetHeight - this.paginationHeight) + console.warn(`this.table.$el.offsetHeight: ${this.table.$el.offsetHeight} --- this.paginationHeight: ${this.paginationHeight} --- tableHeight: ${tableHeight}`) + const footerHeight = (this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0) + this.bodyHeight = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0) + this.fixedBodyHeight = this.scrollX ? this.bodyHeight - this.gutterWidth : this.bodyHeight + + const noData = !this.table.data || this.table.data.length === 0 + this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight + this.syncRowHeight() + this.updateScrollY() + this.notifyObservers('scrollable') + }, 0) } getFlattenColumns () { diff --git a/src/ui/button.css b/src/ui/button.css index 0968150..9f2a4de 100644 --- a/src/ui/button.css +++ b/src/ui/button.css @@ -208,7 +208,7 @@ outline: none; height: 22px; padding: 0; - + .bk-loading-wrapper { display: inline-block; } @@ -447,6 +447,10 @@ transition: background-color ease 0.3s; min-width: 68px; + .bk-loading-wrapper { + opacity: 0; + } + .bk-button-loading { width: 58px; display: inline-block; diff --git a/src/ui/mixins/create-button.css b/src/ui/mixins/create-button.css index a13dfbc..65d1b04 100644 --- a/src/ui/mixins/create-button.css +++ b/src/ui/mixins/create-button.css @@ -34,18 +34,41 @@ } &.is-loading { - cursor: default; + cursor: default; + &:hover, + &.hover { + background-color: $color; + border-color: $color; + opacity: 1; + } + &:active, + &.active { + background-color: $color; + border-color: $color; + } + &.is-outline { + .bk-button-loading { + div { + background-color: $color; + } + } &:hover, &.hover { - background-color: $color; - border-color: $color; - opacity: 1; + .bk-button-loading { + div { + background-color: #fff; + } + } } - &:active, - &.active { - background-color: $color; - border-color: $color; + &.active, + &:active { + .bk-button-loading { + div { + background-color: #fff; + } + } } + } } &.is-outline {