首页 > TAG信息列表 > onBeforeUpdate
Vue3 使用 setup 语法在 v-for 循环中保存 ref 数组
<template> <div> <span v-for="item in content" :ref="setItemRef"> {{ item }}</span> </div> </template> <script setup> import { onBeforeUpdate, ref } from 'vue' const refListvue3-生命周期
链接:http://ggz.longpanda.top/article_detail?id=26 import { onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted, onActivated, onDeactivated, onErrorCaptured } from 'vue' export default { setup() {