diff --git a/src/views/Collection.vue b/src/views/Collection.vue
index 4727e79..af9e13b 100644
--- a/src/views/Collection.vue
+++ b/src/views/Collection.vue
@@ -11,33 +11,44 @@
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
- Play
-
-
-
-
+
+
+
+
+ Play
+
+
+
+
-
-
-
+
+
+
-
-
+
+
+
@@ -55,6 +66,7 @@ export default {
collectionName: "",
totalItems: 0,
itemsPerPage: 10,
+ searchTerm: "",
fields: [
{
key: "cover_url",
@@ -117,9 +129,29 @@ export default {
computed: {
totalPages() {
return Math.ceil(this.totalItems / this.itemsPerPage);
+ },
+ filteredList() {
+
+ if (!this.searchTerm) {
+ return this.tracklist;
+ }
+
+ return this.tracklist.filter(item => {
+ if (item.title.toLowerCase().includes(this.searchTerm.toLowerCase())) {
+ return true;
+ }
+ if (item.album.toLowerCase().includes(this.searchTerm.toLowerCase())) {
+ return true;
+ }
+ if (item.artist.toLowerCase().includes(this.searchTerm.toLowerCase())) {
+ return true;
+ }
+ return false;
+ })
}
}
}
+