1、使用 Vue.component() 方法注冊組件
2、使用 props 屬性傳遞參數
v-for="item in items":
遍歷 Vue 實例中定義的名為 items 的數組,並創建同等數量的組件
:user="item":
將遍歷的 item 項綁定到組件中 props 定義的名為 user 屬性上;= 號左邊的 user 為 props 定義的屬性名,右邊的為 item in items 中遍歷的 item 項的值
父組件給子組件傳參,如果參數不是變量,則定義的屬性無需綁定,user="姓名"
v-bind: 綁定屬性,綁定屬性的目的是 把屬性后面的值變為 變量