Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

nuxt plugin

// Nuxt 3
export default defineNuxtPlugin(nuxtApp => {
	const sayHello = () => {
    	console.log('Hello');
    }
    
    nuxtApp.provide('hello', {
    	sayHello
    });
});
Comment

nuxt custom plugin

export default ({ app, store }, inject) => {
  inject("notifier", {
    showMessage({ content = "", color = "" }) {
      store.commit("snackbar/showMessage", { content, color });
    }
  });
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: js sleep function with argument 
Javascript :: js blur element 
Javascript :: gzip compression angular universal 
Javascript :: get param is react 
Javascript :: body-parser vs express.json 
Javascript :: jquery form submit 
Javascript :: execcommand javascript 
Javascript :: capture keystrokes in javascript 
Javascript :: fetch from vscode 
Javascript :: string splice javascript 
Javascript :: index of an element 
Javascript :: check user login or not in Shopify 
Javascript :: from 0 or 1 to boolean javascript 
Javascript :: angular radio box already showing checked 
Javascript :: async function 
Javascript :: react-select 
Javascript :: react router lazy load 
Javascript :: current date in mongodb 
Javascript :: average of numbers 
Javascript :: jQuery Effects - Fading 
Javascript :: local storage react 
Javascript :: random function in javascript 
Javascript :: change text shadow javascript 
Javascript :: get url of website javascript 
Javascript :: 2d array in js 
Javascript :: match 
Javascript :: copy string js 
Javascript :: background image not loading from a link react 
Javascript :: how to create empty two dimensional array in javascript 
Javascript :: axios post request javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =