Real data loaded in
This commit is contained in:
parent
56f1f8eaaa
commit
85492f8a6e
3 changed files with 10901 additions and 18 deletions
|
@ -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>
|
||||||
|
|
|
@ -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
10890
src/statics/dnd5e.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue