我有一个问题。我有过
data: {
tracks: []
}轨道数组将包含一个复杂的对象。当我指定一个新的值来跟踪嵌套的对象时,就变成了反应性。但我只是不需要深层次的反应物。在没有创建函数或JSON.parse的情况下,我如何做到这一点?
因为使用铯框架和Vue getter的曲目。FPS变成10-15。无Vue有50-60 FPS
发布于 2018-02-05 11:12:50
使用Object.freeze或Object.defineProperty (您只需要配置: false)来防止Vue在大型数据集中获取反应性
https://forum.vuejs.org/t/cesium-and-vue-js-data-getters/26928
发布于 2018-02-02 13:32:27
您可以在轨道上实现深度监视:
watch: {
tracks: {
handler (newVal, oldVal) {
// implement what you want to do here
// If you just wanted to force a re-render you can do:
this.$forceUpdate()
}
deep: true,
}https://stackoverflow.com/questions/48583420
复制相似问题