Top Git Project

Freecodecamp

freeCodeCamp.org's open-source codebase and curriculum....

React

A declarative, efficient, and flexible JavaScript library...

Tensorflow

An Open Source Machine Learning Framework for Everyone

Bootstrap

The most popular HTML, CSS, and JavaScript framework for...

System design-primer

Learn how to design large-scale systems. Prep for the...

Ohmyzsh

🙃 A delightful community-driven (with 1900+...

Flutter

Flutter makes it easy and fast to build beautiful apps...

Javascript

JavaScript Style Guide

Python

All Algorithms implemented in Python

Javaguide

「Java学习+面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识。准备 Java 面试,首选...

How to create a plugin for Nuxt.js

Create a plugin for Nuxt.js and access your global methods entire application

1. Create ./plugins/helpers.js

2. Open and edit ./plugins/helpers.js

import Vue from 'vue'
Vue.mixin({
    methods:{
        testMethod(val){
            console.log(val)
        },
    }
})

3. Edit ./nuxt.config.js

plugins: [
    //...
    { src: '~/plugins/helpers' },
    //...
],

4.Now you can access your global method in vue file

<script>
export default {
    //...
      mounted() {
          this.testMethod('My method is call mounted')
      },
    //...
}
</script>