In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "vue custom components @ click click failure problem how to solve", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "vue custom components @ click click failure problem how to solve" it!
Custom component @ click Click failure problem description
The custom component is unable to bind native click events in the original vue file
Cause analysis
According to the query of the vue official document, we know that the click event acts inside the component, and if the click event is not written in the component, there will be no response.
Problem solving
1. Refer to the official documentation and use @ click.native= "click" to solve the problem.
two。 Can be used: pass events into components, but also in line with the one-way data flow between components, this is how I solved
How to write the main component:
How to write the called component: bind the click to the place inside the custom component where you want click
3. Use $emit to implement event delivery
The writing of the parent component is not affected, but can be written directly according to the original method, which is suitable for obsessive-compulsive disorder and Virgo users.
@ click does not work and reports an error
Click to report an error:
_ vm.gotoExpense is not a functionError: _ vm.gotoExpense is not a functionat http://127.0.0.1:24333/appservice/common/vendor.js:1186:23at Array.forEach () at http://127.0.0.1:24333/appservice/common/vendor.js:1171:23at Array.forEach () at Je.handleEvent [as _ e] (http://127.0.0.1:24333/appservice/common/vendor.js:1161:17)at Object. R.safeCallback (http://127.0.0.1:24333/appservice/dev/WAService.js:2:1827260)at http://127.0.0.1:24333/appservice/dev/WAService.js:2:1966938at s (http://127.0.0.1:24333/appservice/dev/WAService.js:2:1980424)at http://127.0.0.1:24333/appservice/dev/WAService.js:2:1966863at r (http://127.0.) 0.1:24333/appservice/dev/WAService.js:2:1904675)
Check if you * * methods: {} * * have written two!
Thank you for your reading, the above is the "vue custom components @ click click failure problem how to solve" the content, after the study of this article, I believe you on the vue custom components @ click click failure problem how to solve this problem has a deeper understanding, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.