Skip to content

Commit

Permalink
feat: favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed May 14, 2022
1 parent 6cc6312 commit f958e2d
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export default {
sort: {},
hideTable: false,
reportName: '',
favicon: process.env.FAVICON || '/favicon.ico',
};
},
Expand Down Expand Up @@ -916,6 +917,16 @@ export default {
this.$store.dispatch("items", itemsJson.items || []);
this.reportName = itemsJson.name || '';
// favicon
if (itemsJson.favicon) {
this.favicon = itemsJson.favicon;
}
// defaultSort
if (itemsJson.defaultSort && !this.$route.query["sort"]) {
this.sort = itemsJson.defaultSort;
}
// open details when single row
if (this.itemsLength === 1) {
const row = this.filteredItems[0];
Expand All @@ -930,10 +941,6 @@ export default {
this.$route.query["q"] = this.defaultFilter.q;
}
if (itemsJson.defaultSort && !this.$route.query["sort"]) {
this.sort = itemsJson.defaultSort;
}
// q
this.$store.dispatch("q", this.$route.query["q"]);
Expand Down Expand Up @@ -1015,7 +1022,13 @@ export default {
head() {
return {
title: this.pageTitle
title: this.pageTitle,
link: [{
hid: 'icon',
rel: 'icon',
type: 'image/x-icon',
href: this.favicon,
}]
};
}
};
Expand Down

0 comments on commit f958e2d

Please sign in to comment.