Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clean up accumulated vue warnings #1320

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion src/components/BaseKeymap.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
export default {
name: 'base-keymap',
name: 'BaseKeymap',
computed: {
styles() {
let keySize = 0.85;
Expand Down
16 changes: 8 additions & 8 deletions src/components/BrowserWarn.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="browser-warn" v-show="isNotSupported && !isDimissed">
<a class="dismiss" title="dismiss" v-on:click="dismiss">X</a>
<div v-show="isNotSupported && !isDimissed" id="browser-warn">
<a class="dismiss" title="dismiss" @click="dismiss">X</a>
{{ $t('errors.unsupportedBrowser') }}
<a
href="https://www.google.com/intl/en_us/chrome/"
Expand All @@ -20,15 +20,10 @@

<script>
export default {
name: 'browser-warn-bar',
name: 'BrowserWarnBar',
data() {
return { isDimissed: false };
},
methods: {
dismiss() {
this.isDimissed = true;
}
},
computed: {
isNotSupported() {
const usrAgent = window.navigator.userAgent.toLowerCase();
Expand All @@ -40,6 +35,11 @@ export default {
const isFirefox = usrAgent.indexOf('firefox') !== -1;
return !(isChrome || isFirefox);
}
},
methods: {
dismiss() {
this.isDimissed = true;
}
}
};
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ControllerTop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
></v-select>
<a
id="open-on-github"
v-tooltip.bottom="$t('githubKeyboardFolder.title')"
rel="noopener"
target="_blank"
:href="githubKeyboardFolderURL"
v-tooltip.bottom="$t('githubKeyboardFolder.title')"
>
<font-awesome-icon icon="fa-brands fa-github" size="lg" fixed-width />
</a>
Expand Down
8 changes: 4 additions & 4 deletions src/components/ElectronBottomControls.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<template>
<div>
<button
class="fixed-size"
id="fwFile"
@click="autoFlashFirmware"
class="fixed-size"
:title="$t('flashFirmware.title')"
:disabled="disableDownloadBinary"
@click="autoFlashFirmware"
>
<font-awesome-icon icon="download" size="lg" fixed-width />
{{ $t('flashFirmware.label') }}
</button>
<button
class="fixed-size"
id="fwFile"
@click="flashFirmware"
class="fixed-size"
:title="$t('flashFile.title')"
:disabled="disableFlashFile"
@click="flashFirmware"
>
<font-awesome-icon icon="download" size="lg" fixed-width />
{{ $t('flashFile.label') }}
Expand Down
60 changes: 42 additions & 18 deletions src/components/Keycode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,47 @@ import isUndefined from 'lodash/isUndefined';

const debug = false;
export default {
name: 'keycode',
name: 'KeycodeComponent',
props: {
type: String,
code: String,
title: String,
width: null,
name: String,
classes: String,
styles: Object,
layer: Number
type: {
type: String,
default: undefined
},
code: {
type: String,
default: ''
},
title: {
type: String,
default: ''
},
width: {
type: String,
default: undefined
},
Comment on lines +42 to +45
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was width: null previously - is that no longer valid?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on L75 we check if it's undefined, so this is equivalent.

name: {
type: String,
default: ''
},
classes: {
type: String,
default: undefined
},
styles: {
type: Object,
default: () => {}
},
layer: {
type: Number,
default: 0
}
},
data() {
return {
dragging: false,
crt: undefined,
hidden: undefined
};
},
computed: {
computedStyles() {
Expand Down Expand Up @@ -66,12 +97,8 @@ export default {
return this.title ? `${this.code}\n${this.title}` : this.code;
}
},
data() {
return {
dragging: false,
crt: undefined,
hidden: undefined
};
mounted() {
this.hidden = document.getElementsByClassName('qmk-hidden-drag-n-drop')[0];
},
methods: {
dragend() {
Expand Down Expand Up @@ -102,9 +129,6 @@ export default {
layer: this.layer
});
}
},
mounted() {
this.hidden = document.getElementsByClassName('qmk-hidden-drag-n-drop')[0];
}
};
</script>
22 changes: 11 additions & 11 deletions src/components/Keycodes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@
<div id="keycodes">
<div class="tabs">
<span
class="tab"
:class="classes(index)"
v-for="(key, index) in keycodesByGroup"
:key="index"
@click="changeActive(index)"
:title="$t('keycodesTab.' + index + '.label')"
class="tab"
:class="classes(index)"
@click="changeActive(index)"
>{{ $t('keycodesTab.' + index + '.label')
}}<span v-if="searchFilter !== ''"
>({{ searchCounters[index] }})</span
></span
>
<span class="end-tab"
><font-awesome-icon class="keycode-search-icon" icon="search" /><input
@focus="stopListening"
@blur="startListening"
v-model="searchFilter_"
type="text"
:placeholder="$t('searchKeycodes')"
v-model="searchFilter_"
autocomplete="off"
spellcheck="false"
@focus="stopListening"
@blur="startListening"
/></span>
</div>
<div class="tab-area">
<template v-for="(key, index) in activeTab">
<component
v-bind:is="getComponent(key.code)"
:is="getComponent(key.code)"
v-bind="key"
:key="index"
:class="filterClass(key)"
Expand All @@ -66,17 +66,14 @@ import Space from '@/components/Space.vue';
import store from '@/store';

export default {
name: 'keycodes',
name: 'KeycodesComponent',
components: { Keycode, Space },
props: {},
data() {
return {
clearTimeout: undefined
};
},
mounted() {
this.debouncedSetSearchFilter = debounce(this.setSearchFilter, 500);
},
computed: {
...mapGetters('keycodes', ['keycodes']),
...mapState('app', ['configuratorSettings']),
Expand Down Expand Up @@ -106,6 +103,9 @@ export default {
}
}
},
mounted() {
this.debouncedSetSearchFilter = debounce(this.setSearchFilter, 500);
},
methods: {
...mapMutations('app', ['setMessage', 'stopListening', 'startListening']),
...mapMutations('keycodes', ['setSearchFilter', 'changeActive']),
Expand Down
4 changes: 2 additions & 2 deletions src/components/LayerContainerKey.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 key-container"
:class="myclasses"
:style="mystyles"
Expand Down Expand Up @@ -30,7 +30,7 @@ import isUndefined from 'lodash/isUndefined';
import { mapMutations } from 'vuex';
import BaseKey from './BaseKey.vue';
export default {
name: 'layer-container-key',
name: 'LayerContainerKey',
extends: BaseKey,
data() {
return {
Expand Down
Loading
Loading