javascript - How vue.js file app.vue is called
过去多啦不再A梦
过去多啦不再A梦 2017-06-12 09:28:39
0
3
710

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

App.vue configuration

  

main.js file

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?

过去多啦不再A梦
过去多啦不再A梦

reply all (3)
刘奇

Is there no error reported in the terminal?

    世界只因有你

    There is nothing wrong with this. Vue does not stipulate that you must useexport 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 on

      習慣沉默

      The role of vue-loader

      https://vue-loader.vuejs.org/...