hldy_app/unpackage/dist/dev/mp-weixin/component/public/newgame/joysticknew.js

36 lines
1.2 KiB
JavaScript

"use strict";
const common_vendor = require("../../../common/vendor.js");
const common_assets = require("../../../common/assets.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "joysticknew",
emits: ["movecard"],
setup(__props, { emit: __emit }) {
const emit = __emit;
const key = common_vendor.ref(-1);
let resetTimer = null;
function handleClick(dir) {
if (resetTimer !== null) {
clearTimeout(resetTimer);
}
key.value = dir;
emit("movecard", dir);
resetTimer = setTimeout(() => {
key.value = -1;
resetTimer = null;
}, 500);
}
return (_ctx, _cache) => {
return {
a: common_assets._imports_0$11,
b: common_vendor.o(($event) => handleClick(0)),
c: common_vendor.o(($event) => handleClick(3)),
d: common_vendor.o(($event) => handleClick(2)),
e: common_vendor.o(($event) => handleClick(1))
};
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e20c63a2"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/component/public/newgame/joysticknew.js.map