asciibird/src/components/parts/CharPicker.vue

39 lines
704 B
Vue
Raw Normal View History

2021-03-29 08:21:23 +00:00
<template>
2021-08-04 03:21:06 +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)"
2021-08-04 03:21:06 +00:00
>
{{ (char === " ") ? 'space' : char }}
</t-button>
</vue-draggable-resizable>
2021-03-29 08:21:23 +00:00
</template>
<script>
2021-08-04 03:21:06 +00:00
import { charCodes } from '../../ascii';
2021-03-29 08:21:23 +00:00
export default {
2021-08-04 03:21:06 +00:00
name: 'CharPicker',
created() {},
props: ['canvasX', 'canvasY'],
computed: {
charCodes() {
return charCodes;
},
},
2021-03-29 08:21:23 +00:00
methods: {
onCharChange(char) {
2021-08-04 03:21:06 +00:00
this.$store.commit('changeChar', char);
2021-03-29 08:21:23 +00:00
},
},
};
</script>