In the Vue project, the parent component uses $ref to call the method of the child component to report an error. At first, the console will report an error. When the pop-up window is closed and the page is not refreshed, the solution is simple and crude~
Both methods are OK, but the second is more intuitive optimization.
The first method uses a timer to solve the problem that the method is not loaded because the sub components are not mounted when the ref attribute is initially rendered. At this time, this method does not exist, so it cannot be accessed. Add a timer to delay execution. However, if the data is displayed one second later, you will directly see the loading problem of this page;
Therefore, the second method is more appropriate to solve the problem that DOM elements are not loaded. Let the method wait
Read More:
- Vue3. X reports an error using vantui. Failed to resolve component: Van-**-**
- Vue uses this. $refs. Subcomponent Ref. method to report an error: cannot read property ‘resetfields’ of undefined problem
- Unknown custom element: <component> – did you register the component correctly
- Error in value transmission of react parent-child component
- An error is reported when the electron Vue Vue component introduces the electron
- The uni app references the vant component and reports an error unclosed bracket when compiling
- Idea installation vue.js After plug-in, new has no Vue component
- [Vue warn]: Failed to resolve component vue3 import element error
- Vue agent reports an Error 404 nginx configuration method
- Vue error: did you register the component correctly? For.., make sure to provide the “name” option (solved)
- The Vue project cannot use a component name that contains the word switch
- Vue report failed to mount component: template or render function not defined
- Nuxt uses the image lazy to load the lazy component tag, and an error is reported
- #An error is reported by the chart map component of renfast framework
- The common module of idea Maven parent-child project packages and reports an error
- The echots in Vue reports an error. After obtaining the DOM element, the chart can be displayed. The console still reports an error
- HTML method IE8 reports an error, IE8 jQuery Ajax obtains static resources reports an error, typeerror denies access
- Research on invalid modification of elementui component style
- Vue introduces ecarts, init initializes and reports an error
- Failed to start component [standardengine [Catalina]. Standardhost [localhost]. Standardcontext