Property "grades" was accessed during render but is not defined on instance.
时间: 2023-09-24 10:14:05 浏览: 84
This error occurs when you are trying to access a property called "grades" in your component during the render phase, but this property is not defined in the component's data, props, or computed properties.
To fix this error, you need to make sure that the "grades" property is defined in your component. You can define it in the data object like this:
```
data() {
return {
grades: []
}
}
```
Or, if the property is passed down from a parent component as a prop, you can define it in the props object like this:
```
props: {
grades: {
type: Array,
default: []
}
}
```
If the "grades" property is calculated based on other properties in the component, you can define it in the computed properties like this:
```
computed: {
grades() {
// Calculate the grades here
return [...];
}
}
```
Once you have defined the "grades" property in your component, the error should be resolved.
阅读全文