我有一个内部带有子组件的主App.vue。我正在尝试从MovieScreenComponent
中进行滚动,以触发HeaderComponent
中的另一个动作。这可能吗?否则,我必须将所有内容都放在同一组件中。这是我现在拥有的代码设置。
App.vue
<template>
<GridLayout>
<HeaderComponent />
<MovieScreenComponent />
</GridLayout
</template>
<script>
import HeaderComponent from './components';
import MovieScreenComponent from './components';
</script>
MovieScreenComponent.vue
<template>
<GridLayout>
<ScrollView scroll="onScroll"/>
</GridLayout
</template>
<script>
export default {
methods: {
onScroll: function() {
** How can I change something from within the HeaderComponent, such as image opacity, when I am within another component like this **
}
}
}
</script>