首页 > 技术文章 > vue 父组件如何调用子组件的函数Methods

CyLee 2018-02-07 09:42 原文

答案就是使用ref即可。

<countdown  ref="countdown"></countdown>

beforeDestroy () {
      // 切换页面时消灭计时器
      this.$refs.countdown.clearTimer()
}

 

推荐阅读