NuxtN
Nuxt9mo ago
4 replies
FoxCode

Fake Ref

Hey, I have code like this:
watch(tableStatus, (newStatus) => {
    if (newStatus === "success") {
        MAP_COLUMNS = tableData.value.columns
        for (const property in MAP_COLUMNS) {
            VALID_ORDER_BY[property] = property
            MAP_COLUMNS[property].filter_value = ref("")
            console.log("Object:", MAP_COLUMNS[property])
            console.log("Is ref?", isRef(MAP_COLUMNS[property].filter_value))
        }
  }
})

and I’m getting something like this in the console - why isn’t filter_value a ref? And how can I create a ref on‑the‑fly inside a for loop?
image.png
Was this page helpful?