Vue Cli Flashcards
Vue CLI definition:
Vue CLI is a full system for rapid Vue.js development, providing:
Interactive project scaffolding via @vue/cli.
Zero config rapid prototyping via @vue/cli + @vue/cli-service-global.
A runtime dependency (@vue/cli-service) that is:
Upgradeable;
Built on top of webpack, with sensible defaults;
Configurable via in-project config file;
Extensible via plugins
A rich collection of official plugins integrating the best tools in the frontend ecosystem.
A full graphical user interface to create and manage Vue.js projects.
Custom Events
Supongamos que el componente hijo desea modificar algún dato del elemento padre, para esta operación tenemos que emitir un evento que se encuentre previamente configurado en el componente padre.
Padre:
methods: { agregarSaldo() { this.saldo = this.saldo + 100 }, disminuirSaldo() { if (this.saldo === 0) { alert('llegaste al final') return }
Hijo:
{{texto}}
methods: { accion(){ this.$emit('accion') } }
https://bluuweb.github.io/vue-udemy/02-cli/#custom-events