父组件

methods: {
  getList() {
    console.log()
  },
},

子组件

let parent = this.$parent
while (!parent.getList) {
     //无限套娃
     parent = parent['$parent']
}
parent.getList()

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案