0
点赞
收藏
分享

微信扫一扫

vue 中的 ref 简单总结

颜娘娘的碎碎念 2022-03-11 阅读 143
vue.jsref

<template>  
    <Student ref="studentEl"></Student>
</template>


<script>
    const studentByRef = this.$refs.studentEl;
    studentByRef.showStudentName()
</script>

student 组件

 App 组件

vue官网ref介绍

举报

相关推荐

0 条评论