asciibird/src/components/parts/CharPicker.vue

38 lines
748 B
Vue
Raw Normal View History

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