Skip to content

透過下面方式添加項目,會有 bug 無法顯示到畫面上 QQ  #26

Closed
@ayii0111

Description

@ayii0111
<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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions