Skip to content
This repository was archived by the owner on Oct 27, 2021. It is now read-only.

Commit 2a0defa

Browse files
author
yue.peng
committed
fix(modal): fix modal style and footer slot button
1 parent f060117 commit 2a0defa

File tree

2 files changed

+20
-21
lines changed
  • packages

2 files changed

+20
-21
lines changed

packages/taro-ui-vue-demo/src/pages/action/modal/index.vue

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
22
<view class="page">
33
<DocsHeader title="Modal 模态框" />
4-
54
<view class="doc-body">
65
<!-- 基础模态框 -->
76
<view class="panel">
@@ -10,7 +9,7 @@
109
</view>
1110
<view class="panel__content">
1211
<view class="example-item">
13-
<AtButton :on-click="handleClickShow(1)">
12+
<AtButton :on-click="handleClickShow.bind(this,1)">
1413
打开基础模态框
1514
</AtButton>
1615
</view>
@@ -24,7 +23,7 @@
2423
</view>
2524
<view class="panel__content">
2625
<view class="example-item">
27-
<AtButton :on-click="handleClickShow(2)">
26+
<AtButton :on-click="handleClickShow.bind(this,2)">
2827
打开单个按钮模态框
2928
</AtButton>
3029
</view>
@@ -38,7 +37,7 @@
3837
</view>
3938
<view class="panel__content">
4039
<view class="example-item">
41-
<AtButton :on-click="handleClickShow(3)">
40+
<AtButton :on-click="handleClickShow.bind(this,3)">
4241
打开无标题模态框
4342
</AtButton>
4443
</view>
@@ -52,7 +51,7 @@
5251
</view>
5352
<view class="panel__content">
5453
<view class="example-item">
55-
<AtButton :on-click="handleClickShow(4)">
54+
<AtButton :on-click="handleClickShow.bind(this,4)">
5655
打开简化使用模态框
5756
</AtButton>
5857
</view>
@@ -66,7 +65,7 @@
6665
</view>
6766
<view class="panel__content">
6867
<view class="example-item">
69-
<AtButton :on-click="handleClickShow(5)">
68+
<AtButton :on-click="handleClickShow.bind(this,5)">
7069
打开城市索引
7170
</AtButton>
7271
</view>
@@ -77,7 +76,7 @@
7776
<!-- 基础模态框 -->
7877
<AtModal
7978
:is-opened="state.isOpened1"
80-
:on-close="closeModal(1, 'Modal被关闭了')"
79+
:on-close="closeModal.bind(null, 1, 'Modal被关闭了')"
8180
>
8281
<AtModalHeader>标题</AtModalHeader>
8382
<AtModalContent>
@@ -88,17 +87,17 @@
8887
</view>
8988
</AtModalContent>
9089
<AtModalAction>
91-
<button :on-click="closeModal(1, '点击了取消')">
90+
<button @tap="closeModal(1, '点击了取消')">
9291
取消
9392
</button>
94-
<button :on-click="closeModal(1, '点击了确定')">
93+
<Button @tap="closeModal(1, '点击了确定')">
9594
确定
96-
</button>
95+
</Button>
9796
</AtModalAction>
9897
</AtModal>
9998

10099
<!-- 单个按钮 -->
101-
<!-- <AtModal
100+
<AtModal
102101
:is-opened="state.isOpened2"
103102
:on-close="closeModal.bind(this, 2, 'Modal被关闭了')"
104103
>
@@ -109,14 +108,14 @@
109108
</view>
110109
</AtModalContent>
111110
<AtModalAction>
112-
<Button :on-click="closeModal.bind(this, 2, '点击了确定')">
111+
<button @tap="closeModal(2, '点击了确定')">
113112
确定
114-
</Button>
113+
</button>
115114
</AtModalAction>
116-
</AtModal> -->
115+
</AtModal>
117116

118117
<!-- 无标题 -->
119-
<!-- <AtModal
118+
<AtModal
120119
:key="3"
121120
:is-opened="state.isOpened3"
122121
content="这里是正文内容,欢迎加入京东凹凸实验室
@@ -127,10 +126,10 @@
127126
:on-confirm="closeModalConfirm.bind(this, 3, '点击了确认')"
128127
cancel-text="取消"
129128
confirm-text="确认"
130-
/> -->
129+
/>
131130

132131
<!-- 简化使用 -->
133-
<!-- <AtModal
132+
<AtModal
134133
:is-opened="state.isOpened4"
135134
title="标题"
136135
cancel-text="取消"
@@ -139,9 +138,9 @@
139138
:on-close="closeModal.bind(this, 4, 'Modal被关闭了')"
140139
:on-cancel="closeModal.bind(this, 4, '点击了取消')"
141140
:on-confirm="closeModalConfirm.bind(this, 4, '点击了确认')"
142-
/> -->
141+
/>
143142

144-
<!-- <AtModal :is-opened="state.isOpened5">
143+
<AtModal :is-opened="state.isOpened5">
145144
<AtModalContent>
146145
<AtIndexes
147146
:list="mockData"
@@ -153,7 +152,7 @@
153152
</view>
154153
</AtIndexes>
155154
</AtModalContent>
156-
</AtModal> -->
155+
</AtModal>
157156
</view>
158157
</template>
159158

packages/taro-ui-vue/src/style/components/modal.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $at-modal-duration: 200ms;
5959
.at-modal__action {
6060
@include display-flex;
6161

62-
& > button {
62+
& > taro-button-core, button {
6363
@include flex(auto);
6464
@include line(1);
6565
@include active;

0 commit comments

Comments
 (0)