Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js nativescript youtubeplayer在nativescript vue应用程序中全屏切换_Vue.js_Nativescript_Nativescript Vue - Fatal编程技术网

Vue.js nativescript youtubeplayer在nativescript vue应用程序中全屏切换

Vue.js nativescript youtubeplayer在nativescript vue应用程序中全屏切换,vue.js,nativescript,nativescript-vue,Vue.js,Nativescript,Nativescript Vue,我正在尝试在android设备上的nativescript vue应用程序中使用triniwiz/nativescript youtubeplayer插件在youtube播放器中全屏播放,但我无法实现 我有以下代码: <template> <Page actionBarHidden="true" class="page" > <GridLayout orientation="vertical" width="100%" height="100

我正在尝试在android设备上的nativescript vue应用程序中使用triniwiz/nativescript youtubeplayer插件在youtube播放器中全屏播放,但我无法实现

我有以下代码:

<template>
    <Page actionBarHidden="true" class="page" >
        <GridLayout orientation="vertical" width="100%" height="100%" columns="*" rows="*,auto">
            <StackLayout col="0" row="0" backgroundColor="#f8f8f8">
                <StackLayout backgroundColor="#44557f">
                    <Label :text="name" class="font-weight-bold"
                           color="#FFFFFF" padding="15" fontSize="20" textWrap="true"></Label>
                </StackLayout>

                <ScrollView orientation="vertical" height="100%">

                    <ScrollView orientation="vertical">
                        <StackLayout class="home-panel">
                            <YoutubePlayer ref="player" :src="videoLink.substring(17)" apiKey="**********" isFullScreen="true"/>
                        </StackLayout>
                    </ScrollView>
                </ScrollView>
            </StackLayout>
        </GridLayout>
    </Page>
</template>

<script>
    export default {
        props: ['videoLink','name','id'],
        mounted() {
            let player = this.$refs.player
            player.toggleFullscreen();
        }

    }
</script>
但我有个错误

未找到toggleFullscreen


通过Ref访问元素时,返回值将是Vue元素。您应该访问nativeView以访问实际元素

<script>
    export default {
        props: ['videoLink','name','id'],
        mounted() {
            let player = this.$refs.player.nativeView;
            player.toggleFullscreen();
        }

    }
</script>