Fixed PVCard mounted error
This commit is contained in:
@@ -42,10 +42,8 @@
|
|||||||
return `${this.nodeId}.sUnit`
|
return `${this.nodeId}.sUnit`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
mounted() {
|
||||||
mounted() {
|
this.opcuaStore.subscribe([this.valueNodeId, this.unitNodeId])
|
||||||
this.opcuaStore.subscribe([this.valueNodeId, this.unitNodeId])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -11,14 +11,14 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapStores(useOpcuaStore),
|
...mapStores(useOpcuaStore),
|
||||||
formattedString() {
|
formattedString() {
|
||||||
const value = Number(this.opcuaStore.values[this.pvValueNodeId]).toFixed(this.numDecimals)
|
const value = Number(this.opcuaStore.values[this.valueNodeId]).toFixed(this.numDecimals)
|
||||||
const unit = this.opcuaStore.values[this.pvUnitNModeId]
|
const unit = this.opcuaStore.values[this.unitNodeId]
|
||||||
return `${value} ${unit}`
|
return `${value} ${unit}`
|
||||||
},
|
},
|
||||||
pvValueNodeId() {
|
valueNodeId() {
|
||||||
return `${this.nodeId}.rValue`
|
return `${this.nodeId}.rValue`
|
||||||
},
|
},
|
||||||
pvUnitNodeId() {
|
unitNodeId() {
|
||||||
return `${this.nodeId}.sUnit`
|
return `${this.nodeId}.sUnit`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -33,7 +33,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.opcuaStore.subscribe([this.pvValueNodeId, this.pvUnitNodeId])
|
this.opcuaStore.subscribe([this.valueNodeId, this.unitNodeId])
|
||||||
},
|
},
|
||||||
// unmounted() {
|
// unmounted() {
|
||||||
// console.log("Unsubscribed");
|
// console.log("Unsubscribed");
|
||||||
|
|||||||
Reference in New Issue
Block a user