You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
622 B

<template>
<div><div></div></div>
</template>
<script>
export default {
mounted() {
const joystick = nipplejs.create({
zone: this.$el.children[0],
position: { left: "50%", top: "50%" },
dynamicPage: true,
...this.options,
});
joystick.on("start", (e) => this.$emit("start", e));
joystick.on("move", (_, data) => this.$emit("move", { data }));
joystick.on("end", (e) => this.$emit("end", e));
},
props: {
options: Object,
},
};
</script>
<style scoped>
:scope > div {
background-color: AliceBlue;
width: 10em;
height: 10em;
position: relative;
}
</style>