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` return `${this.nodeId}.sUnit`
}, },
}, },
methods: {
mounted() { mounted() {
this.opcuaStore.subscribe([this.valueNodeId, this.unitNodeId]) this.opcuaStore.subscribe([this.valueNodeId, this.unitNodeId])
} }
} }
}
</script> </script>

View File

@@ -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");