Nativescript Vue:如何从其他组件访问/操纵视图属性?

时间:2019-11-02 21:21:38

标签: nativescript nativescript-vue

我有一个内部带有子组件的主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>

0 个答案:

没有答案