define(['vue'], function (Vue) { 'use strict'; Vue.component('shortcut', { data: function () { return { top: '', quick: false }; }, methods: { touchMove: function (event) { event.preventDefault(); var screenHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, oneTenth = screenHeight / 10, min = oneTenth * 2, max = oneTenth * 8; if (min >= event.touches[0].clientY) { this.top = screenHeight / 10 * 2; } else if (event.touches[0].clientY >= max) { this.top = screenHeight / 10 * 8; } else { this.top = event.touches[0].clientY; } } }, template: '
' + '' + '
' + '' + '
' + '
' }); });