Home > Web Front-end > JS Tutorial > body text

How to implement custom global methods in vue

亚连
Release: 2018-06-02 16:55:51
Original
2025 people have browsed it

Now I will introduce to you the use of vue custom global methods in components. It has a very good reference value and I hope it will be helpful to everyone.

Register globally in main.js

Vue.prototype.funcName = function (){}
Copy after login

Can be called in all components

this.
funcName();
Copy after login

The above is what I compiled For everyone, I hope it will be helpful to everyone in the future.

Related articles:

Configure vuex in mpvue and persist it to local Storage Graphic tutorial analysis

nodejs realizes connection to mongodb database Method example

Select selector multi-selection verification method in iview

The above is the detailed content of How to implement custom global methods in vue. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!