bug
This commit is contained in:
@@ -107,12 +107,11 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(['agvObj']),
|
||||
carData () {
|
||||
try {
|
||||
return JSON.parse(this.agvObj)
|
||||
} catch (error) {
|
||||
console.error('解析 JSON 时出错:', error)
|
||||
return {}
|
||||
let res = ''
|
||||
if (this.agvObj !== '') {
|
||||
res = JSON.parse(this.agvObj)
|
||||
}
|
||||
return res
|
||||
}
|
||||
},
|
||||
mixins: [canvasZoomDrag],
|
||||
@@ -124,7 +123,7 @@ export default {
|
||||
this.carPositionWatcher = this.$watch(
|
||||
() => this.carData,
|
||||
(newVal) => {
|
||||
if (newVal && newVal.x !== undefined && newVal.y !== undefined) {
|
||||
if (newVal !== '') {
|
||||
this.redrawCanvas()
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user