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

View file

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

10890
src/statics/dnd5e.json Normal file

File diff suppressed because it is too large Load diff