spiegazione del file importato in Vue CLI (Differenza tra App vs App.vue)

Aug 21 2020

Vue Cli Non capisco correttamente la parte importata. qualcuno può dirmi la differenza tra Vue vs Vue (importa Vue da 'vue') e App Vs App.vue (importa App da App.vue)

importa Vue da "vue" importa App da "./App.vue"

new Vue ({el: '#app', render: h => h (App)})

Risposte

ThibautMaurice Aug 21 2020 at 16:51
// Import vue in itself
import Vue from 'vue'

// Import the App component, you can see it as the root of your app that will contain all of your other components
import App from './App.vue'

// Create a new javascript instance of vue
new Vue({
    render: h => h(App), // This new instance will render the app component
}).$mount('#app') // Actually mount the whole application targeting the #app id in the DOM