mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Fix trying to observe elements not rendered
This commit is contained in:
parent
fd63c02e2a
commit
295284c53f
1 changed files with 12 additions and 6 deletions
|
|
@ -246,10 +246,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
initialList () {
|
||||||
|
return this.initialLimit !== null ? this.appList.slice(0, this.initialLimit) : this.appList
|
||||||
|
},
|
||||||
results () {
|
results () {
|
||||||
if (!this.hasSearchInputText) {
|
if (!this.hasSearchInputText) return this.initialList
|
||||||
return this.initialLimit !== null ? this.appList.slice(0, this.initialLimit) : this.appList
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
...this.titleStartsWithResults,
|
...this.titleStartsWithResults,
|
||||||
|
|
@ -302,12 +303,17 @@ export default {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Start observing all search rows
|
// Start observing all search rows
|
||||||
this.appList.forEach(app => {
|
this.initialList.forEach(app => {
|
||||||
// console.log('this.$refs[`${app.slug}-row`]', this.$refs[`${app.slug}-row`][0])
|
if (this.$refs.hasOwnProperty(`${app.slug}-row`) === false) {
|
||||||
|
console.log('App Row not found', app)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log('this.$refs[`${app.slug}-row`]', this.$refs[`${app.slug}-row`])
|
||||||
this.observer.observe(this.$refs[`${app.slug}-row`][0])
|
this.observer.observe(this.$refs[`${app.slug}-row`][0])
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('appList', this.appList.length)
|
console.log('this.initialList', this.initialList.length)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getAppCategory,
|
getAppCategory,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue