Miscellaneous lint fixes: move watch & mounted properties; apply automatic fixes (#12791)

* commit lint's automatic fixes

* move watch and mounted properties as advised in lint warnings
This commit is contained in:
Alys
2020-11-24 07:14:14 +10:00
committed by GitHub
parent 8bd2e09bde
commit 9b76f9831e
9 changed files with 67 additions and 63 deletions

View File

@@ -384,16 +384,6 @@ export default {
memberResults: [],
};
},
watch: {
'challenge.name': {
handler (newVal) {
this.$store.dispatch('common:setTitle', {
section: this.$t('challenge'),
subSection: newVal.name,
});
},
},
},
computed: {
...mapState({ user: 'user.data' }),
isMember () {
@@ -410,6 +400,16 @@ export default {
return !this.isMember;
},
},
watch: {
'challenge.name': {
handler (newVal) {
this.$store.dispatch('common:setTitle', {
section: this.$t('challenge'),
subSection: newVal.name,
});
},
},
},
mounted () {
if (!this.searchId) this.searchId = this.challengeId;
if (!this.challenge._id) this.loadChallenge();

View File

@@ -56,8 +56,9 @@
</div>
</div>
</filter-group>
<filter-group :title="$t('membership')"
<filter-group
v-if="$route.name !== 'findChallenges'"
:title="$t('membership')"
class="form-group"
>
<div

View File

@@ -496,17 +496,17 @@ export default {
return this.groups.some(g => g.selected);
},
},
watch: {
searchText: throttle(function throttleSearch () {
this.searchTextThrottled = this.searchText.toLowerCase();
}, 250),
},
mounted () {
this.$store.dispatch('common:setTitle', {
subSection: this.$t('items'),
section: this.$t('inventory'),
});
},
watch: {
searchText: throttle(function throttleSearch () {
this.searchTextThrottled = this.searchText.toLowerCase();
}, 250),
},
methods: {
userHasPet (potionKey, eggKey) {
const animalKey = `${eggKey}-${potionKey}`;

View File

@@ -645,12 +645,6 @@ export default {
return Object.values(this.viewOptions).some(g => g.selected);
},
},
mounted () {
this.$store.dispatch('common:setTitle', {
subSection: this.$t('stable'),
section: this.$t('inventory'),
});
},
watch: {
searchText: _throttle(function throttleSearch () {
const search = this.searchText.toLowerCase();
@@ -662,6 +656,12 @@ export default {
},
},
},
mounted () {
this.$store.dispatch('common:setTitle', {
subSection: this.$t('stable'),
section: this.$t('inventory'),
});
},
methods: {
setShowMore (key) {
this.$_openedItemRows_toggleByType(key, !this.$_openedItemRows_isToggled(key));

View File

@@ -1,37 +1,38 @@
<template>
<filter-sidebar>
<filter-group>
<checkbox :checked.sync="viewOptionEntry.selected"
:id="`category-${viewOptionKey}`"
:key="viewOptionKey"
:text="viewOptionEntry.text"
v-for="(viewOptionEntry, viewOptionKey) in viewOptions"
<checkbox
v-for="(viewOptionEntry, viewOptionKey) in viewOptions"
:id="`category-${viewOptionKey}`"
:key="viewOptionKey"
:checked.sync="viewOptionEntry.selected"
:text="viewOptionEntry.text"
/>
</filter-group>
<div class="form-group clearfix">
<h3
class="float-left"
v-once
v-once
class="float-left"
>
{{ $t('hideLocked') }}
</h3>
<toggle-switch
@change="$emit('update:hideLocked', $event)"
class="float-right"
v-model="lockedChecked"
v-model="lockedChecked"
class="float-right"
@change="$emit('update:hideLocked', $event)"
/>
</div>
<div class="form-group clearfix">
<h3
class="float-left"
v-once
v-once
class="float-left"
>
{{ $t('hidePinned') }}
</h3>
<toggle-switch
@change="$emit('update:hidePinned', $event)"
class="float-right"
v-model="pinnedChecked"
v-model="pinnedChecked"
class="float-right"
@change="$emit('update:hidePinned', $event)"
/>
</div>
</filter-sidebar>

View File

@@ -123,12 +123,12 @@
<div class="float-right">
<span class="dropdown-label">{{ $t('sortBy') }}</span>
<select-translated-array
:right="true"
:value="selectedSortItemsBy"
:items="sortItemsBy"
:inline-dropdown="false"
class="inline"
@select="selectedSortItemsBy = $event"
:right="true"
:value="selectedSortItemsBy"
:items="sortItemsBy"
:inline-dropdown="false"
class="inline"
@select="selectedSortItemsBy = $event"
/>
</div>
</div>

View File

@@ -74,12 +74,12 @@
<div class="float-right">
<span class="dropdown-label">{{ $t('sortBy') }}</span>
<select-translated-array
:right="true"
:value="selectedSortItemsBy"
:items="sortItemsBy"
:inline-dropdown="false"
class="inline"
@select="selectedSortItemsBy = $event"
:right="true"
:value="selectedSortItemsBy"
:items="sortItemsBy"
:inline-dropdown="false"
class="inline"
@select="selectedSortItemsBy = $event"
/>
</div>
</div>

View File

@@ -491,16 +491,16 @@ export default {
return tagsByType;
},
},
mounted () {
this.$store.dispatch('common:setTitle', {
section: this.$t('tasks'),
});
},
watch: {
searchText: throttle(function throttleSearch () {
this.searchTextThrottled = this.searchText.toLowerCase();
}, 250),
},
mounted () {
this.$store.dispatch('common:setTitle', {
section: this.$t('tasks'),
});
},
methods: {
...mapActions({ setUser: 'user:set' }),
checkMouseOver: throttle(function throttleSearch () {

View File

@@ -1,17 +1,19 @@
<template>
<span>
<span class="dropdown-label">{{ label }}</span>
<select-list :items="items"
:value="selectedItem"
class="array-select inline"
:right="true"
key-prop="id"
:hide-icon="false"
:inline-dropdown="false"
@select="selectItem($event)">
<select-list
:items="items"
:value="selectedItem"
class="array-select inline"
:right="true"
key-prop="id"
:hide-icon="false"
:inline-dropdown="false"
@select="selectItem($event)"
>
<template v-slot:item="{ item }">
<span :class="{'dropdown-icon-item': withIcon}">
<slot
<slot
name="item"
:item="item"
></slot>