Skip to content

Instantly share code, notes, and snippets.

@cursosdesarrolloweb
Created October 3, 2020 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cursosdesarrolloweb/8f54e47a99bc316456bb3327fb5c4b21 to your computer and use it in GitHub Desktop.
Save cursosdesarrolloweb/8f54e47a99bc316456bb3327fb5c4b21 to your computer and use it in GitHub Desktop.
Vue.component("use-plugin", {
mounted() {
console.log(this.$profile('Israel', 39));
// Mi nombre es Israel, tengo 39 años y trabajo de programador e instructor en Cursosdesarrolloweb"
}
});
app.component("use-plugin", {
setup() {
provideProfile({
name: "Israel",
age: 39,
skills: {
programmer: "Programador PHP, JavaScript y Python",
instructor: "Instructor de cursos en línea de desarrollo web y móvil en Cursosdesarrolloweb"
}
})
const profile = useProfile();
return { profile };
},
template: `
<h2>Crear plugins en Vue 3</h2>
<p>
Nombre: {{ profile.name }}<br />
Edad: {{ profile.age }}<br />
Skills: {{ profile.$skill('programmer') }}
</p>
`
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment