如何正确使用Vue.js的组件

2025-05-07 16:50:22
推荐回答(1个)
回答1:

index.html




    
    cityList


    
111

    
    

app.js

var Vue = require('vue'); 
var App = require('./app.vue'); // 返回的是一个组件,必须注册才能使用
new Vue({
  el:'body',
  components:{
    app: App
  }
});