Nuxt/test/fixtures/runtime-config/pages/index.vue
Pooya Parsa 0337932115
feat: runtime config and built-in dotenv support (#7312)
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2020-05-18 10:21:15 +02:00

31 lines
488 B
Vue

<template>
<pre v-text="JSON.stringify(config, null, 2)" />
</template>
<script>
export default {
asyncData ({ $config }) {
return {
serverConfig: $config
}
},
data () {
return {
clientConfig: { please: 'wait' }
}
},
computed: {
config () {
return {
client: this.clientConfig,
server: this.serverConfig,
$config: this.$config
}
}
},
mounted () {
this.clientConfig = this.$config
}
}
</script>