Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nuxt add plugin

// Nuxt 3
export default defineNuxtPlugin(nuxtApp => {
	const sayHello = () => {
    	console.log('Hello');
    }
    
    nuxtApp.provide('hello', {
    	sayHello
    });
});
 
PREVIOUS NEXT
Tagged: #nuxt #add #plugin
ADD COMMENT
Topic
Name
6+8 =