This commit is contained in:
张磊 2018-11-01 15:04:37 +08:00
parent ac38f5a8b5
commit f8154deb8d
3 changed files with 26 additions and 33 deletions

View File

@ -1893,7 +1893,6 @@ var OmiTouch = function (_WeElement) {
_createClass(OmiTouch, [{
key: 'install',
value: function install() {
this.css = (0, _omi.getHost)(this).css;
}
}, {
@ -1907,7 +1906,7 @@ var OmiTouch = function (_WeElement) {
touch: this.host,
vertical: this.props.vertical === false ? false : true,
target: target,
property: this.props.property || "translateY",
property: this.props.property || 'translateY',
min: this.props.min,
max: this.props.max,
sensitivity: this.props.sensitivity,
@ -1922,7 +1921,6 @@ var OmiTouch = function (_WeElement) {
tap: this.props.tap,
pressMove: this.props.pressMove,
animationEnd: this.props.animationEnd
});
}
}, {

View File

@ -2,8 +2,7 @@
import '../../index'
define('my-app', class extends WeElement {
onChange = (value) => {
onChange = value => {
console.log(value)
}
@ -11,9 +10,8 @@ define('my-app', class extends WeElement {
return (
<div class="main">
<omi-touch min={-1750} max={0} change={this.onChange}>
<div class="touchArea" >
<ul >
<div class="touchArea">
<ul>
<li>Hello, Omi-Touch!</li>
<li>AlloyTouch</li>
<li>Omix</li>
@ -66,7 +64,6 @@ define('my-app', class extends WeElement {
<li style="border-bottom: none;"> row 25</li>
</ul>
</div>
</omi-touch>
</div>
)
@ -115,4 +112,4 @@ define('my-app', class extends WeElement {
}
})
render(<my-app></my-app>, 'body')
render(<my-app />, 'body')

View File

@ -4,39 +4,37 @@ import AlloyTouch from 'alloytouch'
class OmiTouch extends WeElement {
install() {
this.css = getHost(this).css
}
installed() {
var target = this.host.firstChild;
var target = this.host.firstChild
Transform(target);
Transform(target)
new AlloyTouch({
touch: this.host,
vertical: this.props.vertical === false ? false : true,
target: target,
property: this.props.property || "translateY",
min: this.props.min,
max: this.props.max,
sensitivity: this.props.sensitivity,
factor: this.props.factor,
step: this.props.step,
bindSelf: this.props.bindSelf,
preventDefault: this.props.preventDefault === false ? false : true,
change: this.props.change,
touchStart: this.props.touchStart,
touchMove: this.props.touchMove,
touchEnd: this.props.touchEnd,
tap: this.props.tap,
pressMove: this.props.pressMove,
animationEnd: this.props.animationEnd
touch: this.host,
vertical: this.props.vertical === false ? false : true,
target: target,
property: this.props.property || 'translateY',
min: this.props.min,
max: this.props.max,
sensitivity: this.props.sensitivity,
factor: this.props.factor,
step: this.props.step,
bindSelf: this.props.bindSelf,
preventDefault: this.props.preventDefault === false ? false : true,
change: this.props.change,
touchStart: this.props.touchStart,
touchMove: this.props.touchMove,
touchEnd: this.props.touchEnd,
tap: this.props.tap,
pressMove: this.props.pressMove,
animationEnd: this.props.animationEnd
})
}
render(){
render() {
return this.props.children[0]
}
}