Last active
February 15, 2019 19:10
-
-
Save fostergn/3c7eeb654f09a61eee06828e9963ff55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<Loading :is-loading="!hasLoadedData" /> | |
<div v-if="hasLoadedData"> | |
<slot /> | |
</div> | |
</div> | |
</template> | |
<script> | |
import Loading from '@/components/ui/Loading' | |
export default { | |
components: { | |
Loading | |
}, | |
props: [`accountName`, `appName`], | |
data () { | |
return { | |
hasLoadedData: false | |
} | |
}, | |
async created () { | |
const data = await window.Knack.Api.getInitialBuilderData(this.accountName, this.appName) | |
this.$store.dispatch(`load`, data) | |
this.hasLoadedData = true | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment