<script setup>
import { onLoad } from "@dcloudio/uni-app"
import { ref } from "vue"
const test = ref()
const toprintf = () => {
console.log(test)
}
onLoad(() => {})
</script>
<template>
<view ref="test">1111111111</view>
<button @click="toprintf">打印</button>
</template>
<style lang="less" scoped></style>
为什么我不可以通过ref获取盒子的dom(vue3)
问题已解决: