feat: update m-feedback to 2.0.0
parent
bbff1e56b5
commit
2bf65a4828
|
@ -15,14 +15,11 @@ const InputHandler = {
|
|||
},
|
||||
on: this.$listeners,
|
||||
}
|
||||
const spanProps = {
|
||||
attrs: this.$attrs,
|
||||
}
|
||||
return (
|
||||
<Touchable
|
||||
{...touchableProps}
|
||||
>
|
||||
<span {...spanProps}>
|
||||
<span>
|
||||
{this.$slots.default}
|
||||
</span>
|
||||
</Touchable>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
// based on 2.0.0
|
||||
import TouchFeedback from './src/TouchFeedback'
|
||||
export default TouchFeedback
|
||||
|
|
|
@ -26,10 +26,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
triggerEvent (type, isActive, ev) {
|
||||
// const eventType = `on${type}`
|
||||
// if (this.props[eventType]) {
|
||||
// this.props[eventType](ev)
|
||||
// }
|
||||
// 暂时仅有input-number用到,事件直接到挂载到Touchable上,不需要像antd那样从子组件触发
|
||||
this.$emit(type, ev)
|
||||
if (isActive !== this.active) {
|
||||
this.setState({
|
||||
|
@ -50,17 +47,10 @@ export default {
|
|||
this.triggerEvent('touchcancel', false, e)
|
||||
},
|
||||
onMouseDown (e) {
|
||||
// todo
|
||||
// pc simulate mobile
|
||||
// if (this.props.onTouchStart) {
|
||||
this.triggerEvent('touchstart', true, e)
|
||||
// }
|
||||
this.triggerEvent('mousedown', true, e)
|
||||
},
|
||||
onMouseUp (e) {
|
||||
// if (this.props.onTouchEnd) {
|
||||
this.triggerEvent('touchend', false, e)
|
||||
// }
|
||||
this.triggerEvent('mouseup', false, e)
|
||||
},
|
||||
onMouseLeave (e) {
|
||||
|
|
Loading…
Reference in New Issue