如何做请求队列防止网站高并发,网站开发属于什么系统,网站维护流程图,企业网站推广方案设计涉及爷爷组件和孙组件通信#xff0c;孙组件可以 emit 数据到父组件#xff0c;父组件再 emit 数据到爷爷组件#xff0c;实现组件通信#xff0c;但是比较繁琐
使用 $listeners 可以实现孙组件的数据直接传递到爷组件中去
官网原文#xff1a;https://v2.cn.vuejs.org/…涉及爷爷组件和孙组件通信孙组件可以 emit 数据到父组件父组件再 emit 数据到爷爷组件实现组件通信但是比较繁琐
使用 $listeners 可以实现孙组件的数据直接传递到爷组件中去
官网原文https://v2.cn.vuejs.org/v2/guide/components-custom-events.html 原文是利用 listeners 绑定原生事件
孙组件 使用 emit
templatediv孙组件/div
/template
scriptexport default {mounted: function() {this.$emit(emitInfo,这是发送的信息)}};
/script父组件中 给孙组件添加 $listeners
templatediv classchild1-pagediv父组件/div-- 使用孙组件 !--Sun v-on$listeners/Sun/div
/template爷爷组件 监听事件
templatediv classfather-pagediv这是爷爷组件/div-- 使用父组件 !--Father emitInfogetInfo/Father/div
/templatescriptimport Father from ./Fatherexport default {components:{Father},methods: {getInfo:function(data){console.log(data)//这是孙组件发送的信息}}}
/script