面试必问 —— 组件传值(全面)
文章目录父传子一、父传子通过 `props` 接收二、父传子通过 `$attrs` 接收三、`$children`四、`ref`子传父一、`$listeners`二、`$parent`三、自定义事件兄弟传值一、事件中心祖先传后代一、`provide` 和 `inject`其他方法一、`localStorage` 和 `sessionStorage`二、Vuex父传子一、父传子通过 props 接收父组件在子组件的模板中用动态属性传值也可以传递一个对象<children :age="18"
复制链接