1
0
Fork 0

Real data loaded in

This commit is contained in:
Joe Wroten 2017-05-07 20:43:29 -04:00
parent 56f1f8eaaa
commit 85492f8a6e
3 changed files with 10901 additions and 18 deletions

View file

@ -17,20 +17,7 @@ import { Loading } from 'quasar'
import Vue from 'vue'
import { state } from '../store'
import SpellList from './Spelllist'
// import 'whatwg-fetch'
let temporaryData = {
loaded: true,
data: [
{
title: 'example 1',
description: 'foo'
}, {
title: 'example 2',
description: 'bar'
}
]
}
import 'whatwg-fetch'
Vue.component('spell-list', SpellList)
@ -45,10 +32,16 @@ export default {
Loading.show()
}
setTimeout(() => {
this.state.spells = temporaryData
fetch('./statics/dnd5e.json')
.then(response => response.json())
.then(spells => {
this.state.spells = {
loaded: true,
data: spells
}
Loading.hide()
}, 2000)
})
.catch(reason => console.error('Unable to retrieve spells list:', reason))
}
}
</script>

View file

@ -2,7 +2,7 @@
<tr>
<td colspan="3">
<q-collapsible
:label="spell.title"
:label="spell.name"
group="spells"
>
{{spell.description}}

10890
src/statics/dnd5e.json Normal file

File diff suppressed because it is too large Load diff