import
Vue
from
'
vue
'
import
App
from
'
./App
'
import
router
from
'
./router
'
Vue.
config.
productionTip
=
false
/* eslint-disable no-new */
new
Vue({
el:
'
#app
',
router,
components: {
'
app
':
App },
template:
'
<app/>
'
})
// template: '<app/>'相当于把id为app的元素替换成<app/>,然后<app/>又被识别为App组件,也就是App.vue,
当然也可以把<app></app>放在index.html页面效果不同的是id元素没有被替换