You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lililixiaoxian, yusonghuilife, yigaywoligiaogiao, Wxh16144, qiuliangzz and 18 morew245607930w245607930, CoderNanT, heyDaisy, sky124380729 and 70hnXXw245607930, CoderNanT, xzb1996, sky124380729 and 70hnXXw245607930, CoderNanT and sky124380729w245607930, CoderNanT, sky124380729 and 70hnXXw245607930, CoderNanT, sky124380729 and 70hnXXw245607930, CoderNanT, sky124380729, zcywazzt, 70hnXX and 1 more
Activity
xixileng commentedon Jul 1, 2019
创建高级组件
maozhuo123 commentedon Jul 3, 2019
组件传值,祖孙组件有跨度的传值。
webread commentedon Jul 17, 2019
组件传值的时候会用到 爷爷在父亲组件传递值,父亲组件会通过$attrs获取到不在父亲props里面的所有属性,父亲组件通过在孙子组件上绑定$attrs 和 $listeners 使孙组件获取爷爷传递的值并且可以调用在爷爷那里定义的方法
sky124380729 commentedon Oct 16, 2019
一般我对一些UI库进行二次封装用,比如element-ui,里面的组件不能满足自己的使用场景的时候,会二次封装,但是又想保留他自己的属性和方法,那么这个时候时候$attrs和$listners是个完美的解决方案。
简单的例子,对el-button二次封装
radio-qq commentedon Dec 31, 2020
祖孙传值,这也太难了
violet-mio commentedon Jun 24, 2021
对element-ui一些组件进行简易二次封装
sc950828 commentedon Sep 23, 2022
vue2中 $attrs是父组件传递的属性,但是没在子组件用props接收的。
vue2中$listeners是父组件监听的自定义事件,不包括原生事件。