1
0
mirror of https://github.com/kihashi/stardew_community_checklist.git synced 2025-10-19 08:03:17 +00:00

Sort Alphabetically (#93)

This commit is contained in:
John Cleaver 2018-05-21 22:36:50 -04:00 committed by GitHub
parent 95739821c3
commit ea527c8cd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View File

@ -17,6 +17,7 @@
"@fortawesome/fontawesome-free-solid": "^5.0.7",
"@fortawesome/vue-fontawesome": "^0.0.22",
"bulma": "^0.6.2",
"lodash": "^4.17.10",
"mdi-vue": "^0.2.11",
"node-sass": "^4.7.2",
"sass-loader": "^6.0.6",

View File

@ -15,6 +15,7 @@
<script>
import SearchForm from '@/components/search/SearchForm'
import ItemCard from '@/components/item_card/ItemCard'
import _ from 'lodash'
export default {
name: 'search',
components: {
@ -39,10 +40,14 @@ export default {
computed: {
filtered_items () {
var self = this
return self.$store.state.items
return _.orderBy(
self.$store.state.items
.filter(item => item.name.toLowerCase().indexOf(self.search.name_filter.toLowerCase()) !== -1)
.filter(item => this.FilterSeasons(item.seasons.map(ssn => ssn.id), this.search.season_filter))
.filter(item => this.FilterSkills(item.skills.map(skl => skl.id), this.search.skill_filter))
,
'name'
)
}
},
methods: {

View File

@ -3915,6 +3915,10 @@ lodash@^4.0.0, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, l
version "4.17.5"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
lodash@^4.17.10:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
log-symbols@^2.1.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a"