Could someone please clarify the usage of export default
in Vue files? Appreciate it.
For example:
HelloWorld.vue
<template>
<div id="app">
<HelloWorld />
</div>
</template>
<script>
import HelloWorld from "./components/HelloWorld";
export default {
name: "App",
components: {
HelloWorld
}
}
console.log(HelloWorld) // ReferenceError: HelloWorld is not defined
</script>
App.vue
<template>
<div id="app">
<HelloWorld />
</div>
</template>
<script>
import HelloWorld from "./components/HelloWorld";
export default {
name: "App",
components: {
HelloWorld
}
}
console.log(HelloWorld) // HelloWorld is defined
</script>