Added documentation

This commit is contained in:
Matthias Bilger
2023-02-14 19:05:24 +01:00
parent 27e7ae3547
commit 281f173d14
2 changed files with 51 additions and 3 deletions

View File

@@ -36,6 +36,9 @@ export default {
if (!this.options.apiKey) this.error('linkgding apiKey is required');
return this.options.apiKey;
},
filtertags() {
return this.options.tags;
},
},
methods: {
update() {
@@ -50,7 +53,17 @@ export default {
);
},
processData(data) {
this.links = data.results;
const self = this;
const fltr = function (entry) {
if (self.filtertags === null) return true;
for (let i = 0; i < self.filtertags.length; i += 1) {
if (entry.tag_names.includes(self.filtertags[i])) return true;
}
return false;
};
this.links = data.results.filter(
entry => fltr(entry),
);
},
},
};