Skip to content

Commit

Permalink
v 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
shwilliam committed Apr 11, 2019
1 parent 0355685 commit a46ea1c
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 203 deletions.
64 changes: 32 additions & 32 deletions dist/vue-direction.esm.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
var script = {
name: 'VueDirection',
data: function data() {
return {
xDirection: '',
yDirection: '',
oldX: 0,
oldY: 0,
}
},
computed: {
mouseDirection: function mouseDirection() {
return { x: this.xDirection, y: this.yDirection }
},
},
methods: {
getMouseDirection: function getMouseDirection(e) {
if (this.oldX < e.pageX) {
this.xDirection = 'right';
} else {
this.xDirection = 'left';
}
if (this.oldY < e.pageY) {
this.yDirection = 'down';
} else {
this.yDirection = 'up';
}
this.oldX = e.pageX;
this.oldY = e.pageY;
},
},
name: "VueDirection",
data: function data() {
return {
xDirection: "",
yDirection: "",
prevPageX: 0,
prevPageY: 0
};
},
computed: {
mouseDirection: function mouseDirection() {
return { x: this.xDirection, y: this.yDirection };
}
},
methods: {
getMouseDirection: function getMouseDirection(e) {
if (this.prevPageX < e.pageX) {
this.xDirection = "right";
} else {
this.xDirection = "left";
}

if (this.prevPageY < e.pageY) {
this.yDirection = "down";
} else {
this.yDirection = "up";
}

this.prevPageX = e.pageX;
this.prevPageY = e.pageY;
}
}
};

function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-direction.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a46ea1c

Please sign in to comment.