Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nuxt plugin

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