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

Commit 944a7c0

Browse files
committed
fix: ActionSheet
1 parent 4a83749 commit 944a7c0

File tree

7 files changed

+45
-21
lines changed

7 files changed

+45
-21
lines changed

src/components/action-sheet/body/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export default {
99
},
1010
},
1111
render() {
12+
console.log('this.$slots.default', this.$slots.default)
1213
const rootClass = classNames('at-action-sheet__body', this.className)
13-
return <view className={rootClass}>{this.$slots.default}</view>
14+
return <view class={rootClass}>{this.$slots.default}</view>
1415
},
1516
}

src/components/action-sheet/body/item/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export default {
2121
const rootClass = classNames('at-action-sheet__item', this.className)
2222

2323
return (
24-
<view className={rootClass} onTap={this.handleClick}>
25-
{this.slots.default}
24+
<view class={rootClass} onTap={this.handleClick}>
25+
{this.$slots.default}
2626
</view>
2727
)
2828
},

src/components/action-sheet/footer/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default {
2121
const rootClass = classNames('at-action-sheet__footer', this.className)
2222

2323
return (
24-
<view onTap={this.handleClick} className={rootClass}>
24+
<view onTap={this.handleClick} class={rootClass}>
2525
{this.$slots.default}
2626
</view>
2727
)

src/components/action-sheet/header/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export default {
1111
render() {
1212
const rootClass = classNames('at-action-sheet__header', this.className)
1313

14-
return <view className={rootClass}>{this.$slots.default}</view>
14+
return <view class={rootClass}>{this.$slots.default}</view>
1515
},
1616
}

src/components/action-sheet/index.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ export default {
7171
)
7272

7373
return (
74-
<view className={rootClass} onTouchMove={this.handleTouchMove}>
75-
<view onTap={this.close} className="at-action-sheet__overlay" />
76-
<view className="at-action-sheet__container">
74+
<view class={rootClass} onTouchMove={this.handleTouchMove}>
75+
<view onTap={this.close} class="at-action-sheet__overlay" />
76+
<view class="at-action-sheet__container">
7777
{title && <ActionSheetHeader>{title}</ActionSheetHeader>}
7878
<ActionSheetBody>{this.$slots.default}</ActionSheetBody>
7979
{cancelText && (

src/pages/index/demo.jsx

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import ActionSheet from '../../components/action-sheet/index'
2+
import ActionSheetItem from '../../components/action-sheet/body/item/index'
3+
export default {
4+
name: 'Demo',
5+
components: {
6+
ActionSheet,
7+
ActionSheetItem,
8+
},
9+
render() {
10+
return (
11+
<view>
12+
index page!
13+
<ActionSheet isOpened>
14+
<ActionSheetItem>按钮一</ActionSheetItem>
15+
<ActionSheetItem>按钮二</ActionSheetItem>
16+
</ActionSheet>
17+
</view>
18+
)
19+
},
20+
}

src/pages/index/index.vue

+16-13
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,30 @@
22
<view
33
class="index"
44
>
5+
<ActionSheet is-opened>
6+
<ActionSheetItem>
7+
按钮一
8+
</ActionSheetItem>
9+
<ActionSheetItem>
10+
按钮二
11+
</ActionSheetItem>
12+
</ActionSheet>
513
<Badge dot>
614
<Icon
715
class-name="at-icon at-icon-settings"
816
size="30"
917
color="#F00"
1018
/>
1119
</Badge>
12-
<!-- <Button
20+
<Button
1321
loading
1422
type="primary"
1523
:on-click="onClick"
1624
>
1725
hello
18-
</Button> -->
26+
</Button>
1927
<Fab>fab</Fab>
2028
<Avatar text="111" />
21-
<Countdown
22-
is-card
23-
is-show-day
24-
:format="{ hours: ':', minutes: ':', seconds: '' }"
25-
:day="2"
26-
:hours="1"
27-
:minutes="1"
28-
:seconds="10"
29-
/>
3029
<Curtain
3130
:is-opened="show"
3231
:on-close="changeShow"
@@ -109,13 +108,15 @@ import Badge from '../../components/badge/index'
109108
import Icon from '../../components/icon/Icon.vue'
110109
import Fab from '../../components/fab/Fab.jsx'
111110
import Avatar from '../../components/avatar/index.jsx'
112-
import Countdown from '../../components/countdown/index.jsx'
111+
// import Countdown from '../../components/countdown/index.jsx'
113112
import Curtain from '../../components/curtain/index.jsx'
114113
// import LoadMore from '../../components/load-more/index.jsx'
115114
import Noticebar from '../../components/noticebar/index.jsx'
116115
import Tag from '../../components/tag/index.jsx'
117116
import Timeline from '../../components/timeline/index.jsx'
118117
import Divider from '../../components/divider/index.jsx'
118+
import ActionSheet from '../../components/action-sheet/index.jsx'
119+
import ActionSheetItem from '../../components/action-sheet/body/item/index.jsx'
119120
120121
export default {
121122
name: 'Index',
@@ -125,13 +126,15 @@ export default {
125126
Fab,
126127
Avatar,
127128
Badge,
128-
Countdown,
129+
// Countdown,
129130
Curtain,
130131
// LoadMore,
131132
Noticebar,
132133
Tag,
133134
Timeline,
134135
Divider,
136+
ActionSheet,
137+
ActionSheetItem,
135138
},
136139
data() {
137140
return {

0 commit comments

Comments
 (0)