Vue使用組件寫 Todolist 全局組件,局部組件。

  1.全局組件原理結構  使用Vue.component創建全局組件,全局組件中使用v-for,遍歷list中的內容,把item通過v-bind方法,把item用content變量傳給子組件,子組件使用props: ['content']進行接收,template中的使用{{content}}引用變量。 todoitem 標籤中的內容,最終要被templates中的內容替換掉.     2.局部
相關文章
相關標籤/搜索