Skip to content

Commit

Permalink
chore: clean up accumulated vue warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yanfali committed Oct 29, 2023
1 parent db4e127 commit 14699e3
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 25 deletions.
12 changes: 6 additions & 6 deletions src/components/AnyKey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
@dragenter.prevent="dragenter"
><div :class="`${hasFocus ? 'key-layer-title-focus' : 'key-layer-title'}`">{{ displayName }}<div><input
v-if="isShowingKeymapLegends"
ref="input"
v-model="value"
:style="`width:calc(${this.charLength}ch + 6px);`"
class="key-layer-input"
spellcheck="false"
@focus.prevent.stop="focus"
@blur.prevent.stop="blur"
@click.prevent.stop="clickignore"
ref="input"
spellcheck="false"
:style="`width:calc(${this.charLength}ch + 6px);`"
v-model="value" /></div></div><div
@click.prevent.stop="clickignore" /></div></div><div
v-if="visible"
class="remove"
@click.stop="remove"
Expand All @@ -32,7 +32,7 @@
import { mapMutations } from 'vuex';
import BaseKey from './BaseKey.vue';
export default {
name: 'any-key',
name: 'AnyKey',
extends: BaseKey,
data() {
return {
Expand Down
68 changes: 49 additions & 19 deletions src/components/BaseKey.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<!-- prettier-ignore -->
<div
draggable
:id="myid"
draggable
class="key"
:class="myclasses"
:style="mystyles"
Expand Down Expand Up @@ -99,27 +99,64 @@ const getKeySizeClass = (unitheight, unitwidth) => {
};
export default {
name: 'base-key',
name: 'BaseKey',
props: {
id: Number,
meta: Object,
w: Number,
h: Number,
y: Number,
x: Number,
uh: Number,
uw: Number,
colorway: String,
id: {
type: Number,
default: 0
},
meta: {
type: Object,
default: () => {}
},
w: {
type: Number,
default: 0
},
h: {
type: Number,
default: 0
},
y: {
type: Number,
default: 0
},
x: {
type: Number,
default: 0
},
uh: {
type: Number,
default: 0
},
uw: {
type: Number,
default: 0
},
colorway: {
type: String,
default: ''
},
legends: {
type: String,
default: 'keymap'
},
matrix: Array,
matrix: {
type: Array,
default: () => []
},
printable: {
type: Boolean,
default: false
}
},
data() {
return {
inHover: false,
inSwap: false,
platform: undefined
};
},
computed: {
...mapState('keymap', ['config']),
...mapState('keymap', { curLayer: 'layer' }),
Expand Down Expand Up @@ -324,13 +361,6 @@ export default {
}
this.setSelectedContent(id);
}
},
data() {
return {
inHover: false,
inSwap: false,
platform: undefined
};
}
};
</script>
Expand Down

0 comments on commit 14699e3

Please sign in to comment.