Solution: this.$refs refers to subcomponents and reports an error is not a function
-
Description of the problem:
Vue refers to subcomponents through this.$refs, and there is an error of undefined or is not a function -
The error is as follows:
_this3.$refs.fileUpload.changeFileList is not a function
problem analysis:
-
Problem 1: An undefined error occurs
- The tag containing the sub-component needs to be placed in the sub-tag of the first sub-tag, and the ref attribute needs to be set,
Because the logic code of the parent component calls the method or property of the child component through this property.
- The tag containing the sub-component needs to be placed in the sub-tag of the first sub-tag, and the ref attribute needs to be set,
-
Question 2: There is an error of is not a function
- Subcomponents need to be imported, please make sure the path is correct when importing
- After import, you need to register in the component of the parent component
Solution:
- According to the above analysis, the seat number can be modified.
end.