mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add support for custom appList in search
This commit is contained in:
parent
c0d54aa8ce
commit
76ae4fe15c
1 changed files with 8 additions and 4 deletions
|
|
@ -116,6 +116,10 @@ import appList from '~/assets/app-list.json'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
appList: {
|
||||||
|
type: Array,
|
||||||
|
default: () => appList
|
||||||
|
},
|
||||||
quickButtons: {
|
quickButtons: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [
|
default: () => [
|
||||||
|
|
@ -144,7 +148,7 @@ export default {
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
appList,
|
// appList,
|
||||||
query: '',
|
query: '',
|
||||||
// results: [],
|
// results: [],
|
||||||
titleStartsWithResults: [],
|
titleStartsWithResults: [],
|
||||||
|
|
@ -155,7 +159,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
results () {
|
results () {
|
||||||
if (!this.hasSearchInputText) return appList
|
if (!this.hasSearchInputText) return this.appList
|
||||||
|
|
||||||
return [
|
return [
|
||||||
...this.titleStartsWithResults,
|
...this.titleStartsWithResults,
|
||||||
|
|
@ -213,7 +217,7 @@ export default {
|
||||||
},
|
},
|
||||||
scrollInputToTop () {
|
scrollInputToTop () {
|
||||||
scrollIntoView(this.$refs['search'], {
|
scrollIntoView(this.$refs['search'], {
|
||||||
block: 'start',
|
block: 'start',
|
||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -221,7 +225,7 @@ export default {
|
||||||
// Clear any results from before
|
// Clear any results from before
|
||||||
this.titleStartsWithResults = []
|
this.titleStartsWithResults = []
|
||||||
this.titleContainsResults = []
|
this.titleContainsResults = []
|
||||||
this.sectionNameContainsResults = []
|
this.sectionContainsResults = []
|
||||||
|
|
||||||
|
|
||||||
// Snap results scroll position back to top
|
// Snap results scroll position back to top
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue