Skip to content

Commit 5d01d0c

Browse files
authored
Merge pull request #528 from weihongyu12/develop
修复navbar变量名的错误,修复dialog取消按钮无法传递Object的问题
2 parents 57826a7 + db11f92 commit 5d01d0c

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/dialog/dialog.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<template
5050
is="button"
5151
class="{{classPrefix}}__footer-button-host"
52-
data="{{...confirmBtn, block: true, type: 'cancel', externalClass: classPrefix + '__button ' + classPrefix + '__button-cancel ' + (cancelBtn ? classPrefix + '__button-half ' : ' ') + prefix + '-class-cancel'}}"
52+
data="{{...cancelBtn, block: true, type: 'cancel', externalClass: classPrefix + '__button ' + classPrefix + '__button-cancel ' + (cancelBtn ? classPrefix + '__button-half ' : ' ') + prefix + '-class-cancel'}}"
5353
></template>
5454
</block>
5555
<slot name="cancelBtn" />

src/navbar/navbar.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
--navbar-height: 44px;
1515
--navbar-right: 190rpx; // 默认右上角胶囊按钮宽度,组件会在初始化时尝试自动获取胶囊按钮宽度并覆写该值
1616
--narbar-padding-top: 20px; // 导航栏顶部间距,组件会在初始化时尝试取右侧系统胶囊位置进行覆盖
17-
--capsule-wight: 174rpx;
17+
--capsule-width: 174rpx;
1818

1919
overflow: hidden;
2020

@@ -78,7 +78,7 @@
7878
&__capsule {
7979
box-sizing: border-box;
8080
margin-left: 24rpx;
81-
width: var(--capsule-wight);
81+
width: var(--capsule-width);
8282
height: var(--capsule-height);
8383
line-height: var(--capsule-height);
8484
border-radius: 16rpx * 2;

src/navbar/navbar.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,12 @@ export default class Navbar extends SuperComponent {
9999
const ios = !!(res.system.toLowerCase().search('ios') + 1);
100100
const navbarHeight = ios ? 44 : 48;
101101
const boxStyleList = [];
102-
boxStyleList.push(
103-
`--narbar-padding-top:${(rect.bottom + rect.top) / 2 - navbarHeight / 2}px;`,
104-
);
102+
boxStyleList.push(`--narbar-padding-top:${(rect.bottom + rect.top) / 2 - navbarHeight / 2}px;`);
105103
if (rect && res?.windowWidth) {
106104
boxStyleList.push(`--navbar-right:${res.windowWidth - rect.left}px;`); // 导航栏右侧小程序胶囊按钮宽度
107105
}
108106
boxStyleList.push(`--capsule-height:${rect.height}px;`); // 胶囊高度
109-
boxStyleList.push(`--capsule-wight:${rect.width}px;`); // 胶囊宽度
107+
boxStyleList.push(`--capsule-width:${rect.width}px;`); // 胶囊宽度
110108
boxStyleList.push(`--navbar-height:${navbarHeight}px;`); // navbar高度
111109
this.setData({
112110
ios,

0 commit comments

Comments
 (0)