feat: update m-feedback to 2.0.0
parent
bbff1e56b5
commit
2bf65a4828
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -26,10 +26,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
triggerEvent (type, isActive, ev) {
|
triggerEvent (type, isActive, ev) {
|
||||||
// const eventType = `on${type}`
|
// 暂时仅有input-number用到,事件直接到挂载到Touchable上,不需要像antd那样从子组件触发
|
||||||
// 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) {
|
||||||
|
|
Loading…
Reference in New Issue