I am new to vue.js. I only know that main.js is the entry file and app.vue is the total component. Why do I remove the export default code in app.vue and import app from '.app' in main.js? Page But it can display the content in app.vue
I am header!
I am tab
I am content
import Vue from 'vue'; import App from './App'; Vue.config.productionTip = false; /* eslint-disable no-new */ new Vue({ el: '#app', template: ' ', components: { App } });
Can the app.vue file be received without exportmain.js?
Is there no error reported in the terminal?
There is nothing wrong with this. Vue does not stipulate that you must use
export default
. If you want to know the reason, build the example you wrote and look at the code in the generated app.js to know what is going onThe role of vue-loader
https://vue-loader.vuejs.org/...
Without export, it is equivalent to a component with only template option