[Vuejs]-Vue 3 – Component is not loaded or rendering

3πŸ‘

βœ…

The component is not rendered because the array orders is still empty and the watcher to update it is not working properly which should be written by returning props from callback and adding other options (immediate and deep):

let orders = ref([])

watch(()=>props, (newProp, oldProp) => {
  orders.value = tableOrderStore.tableOrders

  console.log(orders.value)
},{
immediate:true,
deep:true //since props are an object
})

Leave a comment