forked from cybrespace/pinafore
31 lines
794 B
HTML
31 lines
794 B
HTML
<div class="lazy-timeline">
|
|
{{#await importTimeline}}
|
|
<!-- awaiting promise -->
|
|
{{then constructor}}
|
|
<:Component {constructor} :timeline />
|
|
{{catch error}}
|
|
<div>Component failed to load. Try refreshing! {{error}}</div>
|
|
{{/await}}
|
|
</div>
|
|
<style>
|
|
.lazy-timeline {
|
|
width: 100%;
|
|
}
|
|
</style>
|
|
<script>
|
|
import { importTimeline } from '../../_utils/asyncModules'
|
|
import { store } from '../../_store/store'
|
|
|
|
export default {
|
|
oncreate () {
|
|
let { currentInstance } = this.store.get()
|
|
let { timeline } = this.get()
|
|
this.store.set({currentTimeline: timeline})
|
|
this.store.setForTimeline(currentInstance, timeline, {runningUpdate: false})
|
|
},
|
|
store: () => store,
|
|
data: () => ({
|
|
importTimeline: importTimeline()
|
|
})
|
|
}
|
|
</script> |