Fixed filtering for object contents
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
e021affd2e
commit
bcd467619d
|
@ -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) {
|
||||
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')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue