vue $emit抛出事件

 子组件

scroll组件 

if(this.isBindScroll){    如果滚动组件需要绑定滚动组件的话 
	let _this=this
	this.scroll.on('scroll',(pos)=>{
		_this.$emit('scroll',pos)    //子组件抛出事件让
	})
}

父组件

 import Scroll from 'src/base/scroll/scroll.vue'

<template>
	<scroll class="listview" 
		@scroll="scroll">   //绑定在调用的子组件上
        <scroll>
<template>

methods:{
	    scroll(pos){   //scroll事件
	    	console.log(pos)
	    }

  

原文地址:https://www.cnblogs.com/yudabing/p/7301802.html