是的,在 Vue 开发中,可以使用 ref 属性引用 el-card 组件。例如:
<template>
<el-card ref="card">
<!-- Card content -->
</el-card>
</template>
<script>
export default {
mounted() {
console.log(this.$refs.card) // 获取 el-card 组件的实例
}
}
</script>
使用 ref 属性引用组件后,可以通过 this.$refs.refName
访问组件实例,并调用组件