test setup(props, context) { const state = reactive({ active: [], }); const myRef = ref("carousel"); const test = () => { console.log(myRef.value); }; onMoun..._vue3 在setup中获取遍历的所有dom">
赞
踩
<template> <div :ref="dom">DOM元素</div> </template> <script> import { nextTick } from 'vue'; export default { setup() { let refs = ''; const dom = el => { refs= el; } nextTick(() => { console.log(refs); }) return { dom }; } }; </script>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。