Vue3.0中如何动态设置ref html中:<div :ref="`Ref${index}`"></div>script中:import { getCurrentInstance } from "vue";const ctx = getCurrentInstance();需要使用动态ref的函数中:ctx.refs[`Ref${index}`].function(); vue.js 2023-09-02 39 点赞 0 评论 59 浏览