asciibird/src/components/parts/CharPicker.vue

37 lines
716 B
Vue
Raw Normal View History

2021-03-29 08:21:23 +00:00
<template>
2021-03-29 08:44:42 +00:00
<vue-draggable-resizable
style="z-index: 5;"
:x="100"
:y="100"
:w="1000"
>
2021-03-29 08:21:23 +00:00
<t-button
type="button"
v-for="(char, keyChar) in charCodes"
2021-03-29 08:21:23 +00:00
:key="keyChar"
class="border-gray-200 p-2 min-h-0"
@click="onCharChange(char)"
>{{ (char === " ") ? 'space' : char }}</t-button>
2021-03-29 08:44:42 +00:00
</vue-draggable-resizable>
2021-03-29 08:21:23 +00:00
</template>
<script>
import { charCodes } from "../../ascii.js"
2021-03-29 08:21:23 +00:00
export default {
name: "CharPicker",
async created() {},
2021-03-29 08:44:42 +00:00
props: ["canvasX", "canvasY"],
computed: {
charCodes() {
return charCodes;
},
},
2021-03-29 08:21:23 +00:00
methods: {
onCharChange(char) {
this.$store.commit("changeChar", char);
},
},
};
</script>