【发布时间】:2020-05-02 08:21:52
【问题描述】:
我有这个。
<template>
<md-dialog :md-active.sync="show"
@md-closed="hideModal"
@md-clicked-outside="hideModal"
class="modal-tabs"
@keypress.enter.prevent="handleEnter"
>
<md-dialog-content ref="my-modal" v-on:scroll.native="handleScrolling" @click.native="handleScrolling">
<!--content-->
</md-dialog-content>
</md-dialog>
</template>
和处理函数是
handleScrolling(): void {
console.log('scroll is on');
this.$root.$emit('scrollingModal', this.$refs['my-modal'].$el.scrollTop);
}
通过点击内容很容易调用,但不能通过滚动内容调用。为什么?问候。
【问题讨论】:
标签: vue.js vue-component