Open VelikayaScarlet opened 10 months ago
已解决 addLabel: function() { let jsonData = JSON.stringify(this.annotator.store.json, null, 2); let list = JSON.parse(jsonData); const newLabelCategory = { id: list.labelCategories.length, text: this.addLabelText, color: this.getRandomColor(), borderColor: this.getRandomColor() }; this.annotator.store.labelCategoryRepo.add(newLabelCategory) this.getCode() },
addLabel: function() {
let newID = -1;
for (let [_, category] of this.annotator.store.labelCategoryRepo) {
newID = category["id"]+1
}
const newLabelCategory = {
id: newID,
text: this.addLabelText,
color: this.getRandomColor(),
borderColor: this.getRandomColor()
};
this.annotator.store.labelCategoryRepo.add(newLabelCategory)
console.log(this.labelCategories);
this.getCode()
},
vue.esm.js:591 [Vue warn]: Error in event handler for "click": "TypeError: Cannot read properties of undefined (reading 'trim')"
found in
--->