【问题标题】:PrimeVue Datable not updatingPrimeVue 数据不更新
【发布时间】:2022-01-31 03:37:57
【问题描述】:

我对 Vue 和 JS 还很陌生,所以我很难理解它们是如何工作的。我来自 Swift,也许这就是问题所在。

我试图让 Primevue 数据表在更改与其连接的 ref 中的值时更新其值。但是屏幕上没有任何反应,但是 console.log 文件显示了新数据。

//Vue composition api setup()

const { flights } = getCollection("Jobs", shift.value.email, fullDay + platform.value.name)// Firebase Listener
       
        
//This function is triggered by some select buttons which changes the shift.value and platform.value so to listen for data in a different collection

const loadFlights = () => {    
  let {flights: fl} = getCollection("Jobs", shift.value.email, fullDay + platform.value.name) 
  flights.value = fl.value
  console.log('flights ref:', fl, ) // shows new the data, but the datable does not.
}

如果我没有单击以更改为不同的集合,则数据表会很好地更新当前集合。我缺少某种“tableview.reload()”功能吗?

【问题讨论】:

    标签: javascript vuejs3 vue-composition-api primevue


    【解决方案1】:

    解决了。我使用了来自 vue 的 watch ,它在每次选择值更改时触发。 然后我将响应存储在反应参数而不是参考中。现在它可以正常工作了。不能告诉你为什么。

    https://youtu.be/Qypxpm-llnQ 与 Erik 一起编程很可能可以。

    【讨论】:

      猜你喜欢
      • 2013-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-12
      • 2021-03-24
      • 2019-01-17
      • 2021-12-22
      相关资源
      最近更新 更多