<template>
<uni-badge text="1" ref='badge'></uni-badge>
<uni-badge text="2" type="success" @click="bindClick"></uni-badge>
<uni-badge text="3" type="primary" :inverted="true"></uni-badge>
</template>
<script setup>
import {ref,onMounted} from 'vue'
const badge = ref()
console.log(badge.value);
</script>
获取不到ref对象
1***@qq.com (作者)
那请问一下老哥 就是用的uni组件 有的方法是拿到节点后用他的open方法 这个时候拿不到怎么办啊
2023-11-18 13:31
1***@qq.com (作者)
非常感谢
2023-11-18 13:32
喜欢技术的前端
回复 1***@qq.com:
2023-11-18 14:08
喜欢技术的前端
回复 1***@qq.com: 以uni-popup 为例,正常使用 popup.value.open('center')
2023-11-18 14:08
s***@126.com
不用改为div,在value后面加个“$el”即可,最后变成这样:hello.value.$el.innerText = '内容被修改'
2024-02-21 09:54
s***@126.com
试试popup.value.$el.open('center')?
2024-02-21 09:54