feat: update m-feedback to 2.0.0

pull/309/head
tangjinzhou 2018-11-02 21:45:11 +08:00
parent bbff1e56b5
commit 2bf65a4828
3 changed files with 3 additions and 16 deletions

View File

@ -15,14 +15,11 @@ const InputHandler = {
}, },
on: this.$listeners, on: this.$listeners,
} }
const spanProps = {
attrs: this.$attrs,
}
return ( return (
<Touchable <Touchable
{...touchableProps} {...touchableProps}
> >
<span {...spanProps}> <span>
{this.$slots.default} {this.$slots.default}
</span> </span>
</Touchable> </Touchable>

View File

@ -1,3 +1,3 @@
// based on 2.0.0
import TouchFeedback from './src/TouchFeedback' import TouchFeedback from './src/TouchFeedback'
export default TouchFeedback export default TouchFeedback

View File

@ -26,10 +26,7 @@ export default {
}, },
methods: { methods: {
triggerEvent (type, isActive, ev) { triggerEvent (type, isActive, ev) {
// const eventType = `on${type}` // input-numberTouchableantd
// if (this.props[eventType]) {
// this.props[eventType](ev)
// }
this.$emit(type, ev) this.$emit(type, ev)
if (isActive !== this.active) { if (isActive !== this.active) {
this.setState({ this.setState({
@ -50,17 +47,10 @@ export default {
this.triggerEvent('touchcancel', false, e) this.triggerEvent('touchcancel', false, e)
}, },
onMouseDown (e) { onMouseDown (e) {
// todo
// pc simulate mobile // pc simulate mobile
// if (this.props.onTouchStart) {
this.triggerEvent('touchstart', true, e)
// }
this.triggerEvent('mousedown', true, e) this.triggerEvent('mousedown', true, e)
}, },
onMouseUp (e) { onMouseUp (e) {
// if (this.props.onTouchEnd) {
this.triggerEvent('touchend', false, e)
// }
this.triggerEvent('mouseup', false, e) this.triggerEvent('mouseup', false, e)
}, },
onMouseLeave (e) { onMouseLeave (e) {