The contents of my main.js
file in the app are as follows:
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
const app = createApp(App)
const globalProps = app.config.globalProperties
app.use(router).mount('#app')
globalProps.msg = 'one, two, three'
Additionally, there is a component called App.vue
with the following structure:
<template>
<router-view/>
</template>
<script setup>
console.log(app.config)
</script>
<style>
@import 'assets/style.css';
</style>
When attempting to access the global properties using app.config
inside my component, I receive an output of undefined
. Can you help me identify what mistake I might be making?