Skip to content
Permalink
Browse files

feat: finishing prototype for stalker index page

  • Loading branch information...
108kb committed Apr 13, 2019
1 parent 4128d18 commit da576e60982f2235b401e28e6118e46a06d601ae
Showing with 10 additions and 1 deletion.
  1. +10 −1 pages/_stalker/index.vue
@@ -33,6 +33,7 @@
:title="normalizeURL(data.url)"
:title-raw="data.url"
:image="data.icon"
:sizes="sizes[data.id]"
:is-https="isHTTPS(data.url)"
:link="`/stalker/${data.id}`"
/>
@@ -58,7 +59,8 @@ export default {
List: () => import('~/components/List')
},
data: () => ({
datas: []
datas: [],
sizes: {}
}),
mounted () {
this.getDatas()
@@ -77,6 +79,13 @@ export default {
.then(res => res.json())
.then(res => {
this.datas = res.data
this.datas.map(data => {
requestIdleCallback(() => {
return fetch(`https://stalker.108kb.io/api/getData/${data.id}`)
.then(res => res.json())
.then(res => this.$set(this.sizes, data.id, res.total))
})
})
})
.catch(err => {
console.error('Something went wrong ', err)

0 comments on commit da576e6

Please sign in to comment.
You can’t perform that action at this time.