Nuxt/test/fixtures/basic/pages/config.vue
Alexander Lichter cb18aa6f53 feat: add Vue.config configuration to nuxt.config.js (#3655)
After #3564 and the request of #3427  (plus #3452) I decided to add a dedicated `vueConfig`object to the `nuxt.config.js` file.

The keys will be projected on Vue.config.

By default, `Vue.config.performance` is enabled in dev mode, `Vue.config.silent` is enabled in production mode.

Doc PR incoming.

Resolves: #2910, #3427
2018-08-08 20:05:23 +01:00

28 lines
494 B
Vue

<template>
<div>
<span v-for="(key,i) in configKeys" :id="key" :key="i">{{ vueConfig[key] | toStr }}</span>
</div>
</template>
<script>
import Vue from 'vue'
export default {
filters: {
toStr(v) {
return String(v)
}
},
data() {
return {
vueConfig: Vue.config
}
},
computed: {
configKeys: function () {
return Object.keys(this.vueConfig).filter(k => ['silent', 'devtools', 'performance', 'productTip'].includes(k))
}
}
}
</script>