general option component (canvas size)

This commit is contained in:
Gator
2022-01-10 14:16:34 +01:00
parent 74a1b311b7
commit 38f66a9090
3 changed files with 46 additions and 18 deletions

View File

@ -9,7 +9,8 @@
id="canvasWidth"
name="canvasWidth"
type="number"
value="1280"
:value="canvasWidth"
@input="updateCanvasWidth"
>
</div>
<div class="form-field">
@ -17,15 +18,8 @@
id="canvasHeight"
name="canvasHeight"
type="number"
value="1024"
>
</div>
<div class="form-field">
<input
id="canvasRefresh"
type="button"
name="canvasRefresh"
value="refresh"
:value="canvasHeight"
@input="updateCanvasHeight"
>
</div>
</form>
@ -33,11 +27,28 @@
</template>
<script>
import MenuRow from './MenuRow.vue'
export default {
import MenuRow from './MenuRow.vue'
import {mapGetters} from 'vuex'
export default {
name: 'MenuGeneralOptions',
components: {
MenuRow
},
computed: {
...mapGetters({
canvasWidth: 'getCanvasWidth',
canvasHeight: 'getCanvasHeight'
})
},
methods: {
updateCanvasHeight: function(event) {
const elem = event.target
this.$store.commit('setCanvasHeight', elem.value)
},
updateCanvasWidth: function(event) {
const elem = event.target
this.$store.commit('setCanvasWidth', elem.value)
}
}
}
</script>