Fixed PVCard mounted error
This commit is contained in:
@@ -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>
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user