[improvement] SwipeCell: jsx (#2632)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { on, off } from '../utils/event';
|
||||
|
||||
export default config => ({
|
||||
mounted() {
|
||||
config.handler = event => {
|
||||
if (!this.$el.contains(event.target)) {
|
||||
this[config.method]();
|
||||
}
|
||||
};
|
||||
|
||||
on(document, config.event, config.handler);
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
off(document, config.event, config.handler);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user