访问vue组件时未定义

时间:2018-04-10 05:48:05

标签: javascript vue.js

我尝试访问Vue文件中的Vue组件。

<template>
    {{this.tables}}
</template>


export default {
name: 'test',
data() {
    return {

    }
},

computed:{
    tables() {
        console.log(this.$children);

    },
}

当我使用console.log(this.$children);时,结果如下 enter image description here

现在,我想从display_table vuecomponent访问并获取$children的项目。所以我使用console.log(this.$children[0]);,但这个返回undefined。有人可以告诉我一些有关如何获取display_table中的项目的见解吗?

0 个答案:

没有答案