Closed
Description
<script setup>
const arrRef = ref([11, 22])
const numRef = ref(0)
watch(numRef, () => {
arrRef.value.push({ [numRef.value]: numRef.value })
console.log(arrRef.value) // 可以在控制台中看見,arrRef 陣列一直添加,但畫面上卻沒有響應
})
function foo () {
numRef.value++
}
</script>
<template>
<div class="box">
<button @click="foo">
foo
</button>
<h4>Dark</h4>
<JsonViewer :value="arrRef" copyable boxed sort theme="dark" />
</div>
</template>
<style></style>
Metadata
Metadata
Assignees
Labels
No labels