Fixed PVCard mounted error

This commit is contained in:
2025-11-19 07:52:26 +01:00
parent 4cf4d22652
commit d0d1879fd5
2 changed files with 7 additions and 9 deletions

View File

@@ -42,10 +42,8 @@
return `${this.nodeId}.sUnit`
},
},
methods: {
mounted() {
this.opcuaStore.subscribe([this.valueNodeId, this.unitNodeId])
}
mounted() {
this.opcuaStore.subscribe([this.valueNodeId, this.unitNodeId])
}
}
</script>

View File

@@ -11,14 +11,14 @@ export default {
computed: {
...mapStores(useOpcuaStore),
formattedString() {
const value = Number(this.opcuaStore.values[this.pvValueNodeId]).toFixed(this.numDecimals)
const unit = this.opcuaStore.values[this.pvUnitNModeId]
const value = Number(this.opcuaStore.values[this.valueNodeId]).toFixed(this.numDecimals)
const unit = this.opcuaStore.values[this.unitNodeId]
return `${value} ${unit}`
},
pvValueNodeId() {
valueNodeId() {
return `${this.nodeId}.rValue`
},
pvUnitNodeId() {
unitNodeId() {
return `${this.nodeId}.sUnit`
},
},
@@ -33,7 +33,7 @@ export default {
},
},
mounted() {
this.opcuaStore.subscribe([this.pvValueNodeId, this.pvUnitNodeId])
this.opcuaStore.subscribe([this.valueNodeId, this.unitNodeId])
},
// unmounted() {
// console.log("Unsubscribed");