Fixed filtering for object contents
the build was successful Details

This commit is contained in:
konrad 2017-11-14 11:18:38 +01:00 committed by kolaente
parent e021affd2e
commit bcd467619d
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 9 additions and 5 deletions

View File

@ -24,7 +24,7 @@
{{ success }}
</div>
<div v-if="!loading">
<div v-if="!loading && !error">
<router-link to="/books/add" class="ui green labeled icon button" style="float: right;">
<i class="plus icon"></i>
@ -123,7 +123,11 @@ export default {
if (filterKey) {
data = data.filter(function (row) {
return Object.keys(row).some(function (key) {
return String(row[key]).toLowerCase().indexOf(filterKey) > -1
if (row[key].content) {
return String(row[key].content).toLowerCase().indexOf(filterKey) > -1
} else {
return String(row[key]).toLowerCase().indexOf(filterKey) > -1
}
})
})
}
@ -164,7 +168,7 @@ export default {
this.loading = false
})
.catch(e => {
console.log(e)
this.loading = false
this.error = e
})
},
@ -186,8 +190,8 @@ export default {
console.log(e)
})
},
editBook (id) {
console.log(id, 'edit')
editBook (book) {
console.log(book, 'edit')
}
}
}