用EventBus来传递数据

114 阅读1分钟

先创建一个bus文件

image.png 在html文件中 product-total组件在create()方法下,用$on给bus绑定countChange,然后更改自己的totalCount数据

image.png