vue組件 emit調用

  • emit方式調用父組件的方法
  • 還能夠用$parent.list(1)
//1 父組件
<editcomponent ref="edit" @toList="list(1)" ></editcomponent>
自定義事件, 事件名爲toList


//2 子組件 
self.$emit('toList');//向父組件emit toList事件
相關文章
相關標籤/搜索