I'm having an issue with my vue webapp. I want to make a square shape appear on the screen where a user clicks, but for some reason, my code isn't working as intended. Can someone help me figure out what's wrong?
<template>
<div class="shapepage" @click="attachShape"></div>
</template>
<script>
export default {
name: "ShapePage",
methods: {
attachShape: (e) => {
render: (createElement) => {
return createElement('div', {
style: {
width: "100px",
height: "100px",
background: "red",
color: "white",
position: "absolute",
left: "50",
top: "50"
}
});
}
}
}
}
</script>
<style>
body {
background-color: rgba(245, 245, 245, 1);
}
.shapepage {
margin-top: 20px;
max-width: 500px;
height: 500px;
margin-left: auto;
margin-right: auto;
background-color: #fff;
box-shadow: 0px 0px 5px 1px grey;
}
</style>