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

Commit

Permalink
fix(AtFab): 修复 AtFab 点击事件
Browse files Browse the repository at this point in the history
  • Loading branch information
psaren committed May 30, 2020
1 parent 91bb7ca commit 3609d01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/fab/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export default {
type: [Object, String],
default: '',
},
handleClick: {
onClick: {
type: Function,
default: () => () => {},
},
},
methods: {
handleTab(event) {
this.handleClick && this.handleClick(event)
this.onClick && this.onClick(event)
},
},
render() {
Expand All @@ -28,7 +28,7 @@ export default {
[`at-fab--${size}`]: size,
})
return (
<view class={rootClass} onTab={this.handleTab}>
<view class={rootClass} onTap={this.handleTab}>
{this.$slots.default}
</view>
)
Expand Down
6 changes: 6 additions & 0 deletions src/pages/demo/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<text />
<view />
<input type="text">
<AtFab :on-click="clickFab">
fab
</AtFab>
<AtBadge dot>
<AtButton loading>
按钮文字
Expand Down Expand Up @@ -110,6 +113,9 @@ export default {
},
clickAccordion() {
this.open = !this.open
},
clickFab(e) {
console.log('clickFab', e)
}
}
}
Expand Down

0 comments on commit 3609d01

Please sign in to comment.