Skip to content

Commit a59ec63

Browse files
miaodongqing陌缓
andauthored
chore(Modal): adjust style & add zIndex disableSrcoll animation props… (#128)
* chore(Modal): adjust style & add zIndex disableSrcoll animation props in Modal and Dialog * chore(Icon): support fontSize prop Co-authored-by: 陌缓 <[email protected]>
1 parent 20a56cf commit a59ec63

File tree

11 files changed

+66
-54
lines changed

11 files changed

+66
-54
lines changed

demo/pages/Modal/index.axml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</modal>
2121
<modal
2222
visible="{{isCustomBtnModalShow}}"
23-
content="人在天边月上明,风初紧,吹入画帘旌"
23+
content="人在天边月上明"
2424
mainButtonText="在线阅读"
2525
addonButtonText="下载文件"
2626
maskClosable="{{false}}"
@@ -29,7 +29,7 @@
2929
</modal>
3030
<modal
3131
visible="{{isMainBtnModalShow}}"
32-
content="人在天边月上明,风初紧,吹入画帘旌"
32+
content="人在天边月上明"
3333
mainButtonText="在线阅读"
3434
addonButtonText=""
3535
maskClosable="{{false}}"

src/Dialog/index.axml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
visible="{{visible}}"
44
maskClosable="{{maskClosable}}"
55
duration="{{duration}}"
6+
disableScroll="{{disableScroll}}"
7+
animation="{{animation}}"
8+
zIndex="{{zIndex}}"
69
onClose="onClose">
710
<view class="amd-dialog-content">
811
<view class="amd-dialog-content-image-container">
9-
<image class="amd-dialog-content-image amd-dialog-content-image-{{imageSize}}"
10-
src="{{image}}"
11-
a:if="{{image}}" />
12+
<image class="amd-dialog-content-image amd-dialog-content-image-{{imageSize}}"
13+
src="{{image}}"
14+
a:if="{{image}}"
15+
/>
1216
</view>
1317
<view class="amd-dialog-content-title">
1418
{{title}}

src/Dialog/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949
&:empty ~ .amd-dialog-content-content {
5050
margin-bottom: 5 * @rpx;
51-
margin-top: 16 * @rpx;
51+
margin-top: 40 * @rpx;
5252
}
5353
}
5454

src/Dialog/index.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ toc: false
2727
| visible | boolean || false | 是否可见,受控模式 |
2828
| duration | number || 300 | 过渡动画时长,单位毫秒 |
2929
| maskClosable | boolean || true | 点击蒙层关闭 |
30+
| disableScroll | boolean || true | 弹窗展示时,是否禁止页面滚动 |
31+
| animation | boolean || true | 是否开启过渡动画 |
32+
| zIndex | number || 998 | 弹窗层级 |
3033
| className | string || - | 类名 |
3134

3235
## 事件
@@ -57,17 +60,17 @@ toc: false
5760

5861

5962
<style>
60-
table th:first-of-type { width: 180px; }
61-
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
62-
width: 140px
63-
}
64-
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
65-
width: 30px
66-
}
67-
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
68-
width: 50px
69-
}
70-
.__dumi-default-layout-content article table:nth-of-type(4) th:first-of-type {
71-
width: 300px
72-
}
63+
table th:first-of-type { width: 180px; }
64+
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
65+
width: 140px;
66+
}
67+
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
68+
width: 30px;
69+
}
70+
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
71+
width: 50px;
72+
}
73+
.__dumi-default-layout-content article table:nth-of-type(4) th:first-of-type {
74+
width: 300px;
75+
}
7376
</style>

src/Icon/index.axml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<import-sjs name="icon"
22
from='./index.sjs' />
33
<text class="amd-icon amd-icon-{{type}} {{icon.getSize(size)}} {{className ? className : ''}}"
4-
style="{{color ? `color: ${color};` : ''}}"
4+
style="{{color ? `color: ${color};` : ''}} {{fontSize ? `font-size: ${fontSize};`: ''}}"
55
onTap="onTap">
66
</text>

src/Icon/index.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ toc: false
2323
| type | string || "" | icon 图标的类型 |
2424
| size | 'x-small' &verbar; 'small' &verbar; 'medium' &verbar; 'large' &verbar; 'x-large' || "medium" | icon 的大小,x-small(16)、small(32)、medium(48)、large(64)、x-large(128), |
2525
| color | string || - | icon 的颜色,即 CSS 中 color 属性的值 |
26+
| fontSize | string || - | icon 的大小 |
2627
| className | string || - | 类名 |
2728

2829
## 事件
@@ -37,15 +38,15 @@ toc: false
3738
| amd-icon | 整体样式 |
3839

3940
<style>
40-
table th:first-of-type { width: 180px; }
41-
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
42-
width: 140px
43-
}
44-
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
45-
width: 30px
46-
}
47-
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
48-
width: 50px
49-
}
41+
table th:first-of-type { width: 180px; }
42+
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
43+
width: 140px;
44+
}
45+
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
46+
width: 30px;
47+
}
48+
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
49+
width: 50px;
50+
}
5051

5152
</style>

src/Modal/index.axml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
visible="{{visible}}"
44
duration="{{duration}}"
55
maskClosable="{{maskClosable}}"
6+
disableScroll="{{disableScroll}}"
7+
animation="{{animation}}"
8+
zIndex="{{zIndex}}"
69
onClose="onClose">
710
<view class="amd-modal-content">
811
<view class="amd-modal-content-image-container">

src/Modal/index.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ toc: false
2929
| mainButtonText | string || '主操作' | 主按钮 |
3030
| addonButtonText | string || '辅助操作' | 辅助按钮,第二个按钮 |
3131
| maskClosable | boolean || true | 点击蒙层关闭 |
32+
| disableScroll | boolean || true | 弹窗展示时,是否禁止页面滚动 |
33+
| animation | boolean || true | 是否开启过渡动画 |
34+
| zIndex | number || 998 | 弹窗层级 |
3235
| className | string || - | 类名 |
3336

3437
## 事件
@@ -58,17 +61,17 @@ toc: false
5861
| amd-modal-close | close 图标样式 |
5962

6063
<style>
61-
table th:first-of-type { width: 180px; }
62-
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
63-
width: 140px
64-
}
65-
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
66-
width: 30px
67-
}
68-
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
69-
width: 50px
70-
}
71-
.__dumi-default-layout-content article table:nth-of-type(4) th:first-of-type {
72-
width: 300px
73-
}
64+
table th:first-of-type { width: 180px; }
65+
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
66+
width: 140px;
67+
}
68+
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
69+
width: 30px;
70+
}
71+
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
72+
width: 50px;
73+
}
74+
.__dumi-default-layout-content article table:nth-of-type(4) th:first-of-type {
75+
width: 300px;
76+
}
7477
</style>

src/Popup/index.axml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
onTouchMove="{{disableScroll && supportSjs ? _sjs.enableScrollEvent : ''}}"
1414
>
1515
<view class="amd-popup-close-container" a:if="{{showCloseIcon}}">
16-
<icon type="CloseOutline" size="x-small" onTap="onClose"/>
16+
<icon type="CloseOutline" onTap="onClose"/>
1717
</view>
1818
<view>
1919
<slot />

src/Popup/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
justify-content: center;
2020
right: 24 * @rpx;
2121
.amd-icon {
22-
font-size: 26 * @rpx;
22+
font-size: 36 * @rpx;
2323
display: flex;
2424
align-items: center;
2525
justify-content: center;

0 commit comments

Comments
 (0)