Vuejs (Autosaved)
Vuejs (Autosaved)
js
• The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or
existing projects
• On the other hand, Vue is also perfectly capable of powering sophisticated Single-Page Applications
Below is a diagram for the instance lifecycle.
You don’t need to fully understand everything going on
right now, but as you learn and build more, it will be a useful reference.
Vue.js Directives
• Directives are the part of Vue.js that attach special meaning and behavior to plain html elements on the page
Vue.js V-model
• v-model directive to make two way binding between the HTML element and
the data attribute it refers to in the Vue JavaScript code
Vue.js Conditionals and Loops
• v-if directive can be used to test some conditions over the JavaScript object data
• v-else directive can be used when the conditions on the v-if fails
• v-else-if directive can be used much like you would use else-if clauses in JavaScript
Vue.js Directives Summary
• v-model: used to create a two way binding between the element and the data
• v-bind: used to dynamically bind one or more attributes, or a component prop, to an expression
• At the main.js:
npm install
npm install axios --save
Vue.js connecting with the back-end
• Front-end:
• Create a file and declare an AXIOS constant and import it on
App.vue component
• Axios is a HTTP client write base on Promises
Vue.js connecting with the back-end
Front-end:
• Declaredatatoholdtheinformation,a new object and an array
of news.
Vue.js Tools
Vue.js 42
Vue.js Tools
Visual Studio Code
• Syntax Highlight
• Compiler
• Integrated Terminal
Vue Extensions
For development install Vue.js devtools on Firefox or Chrome
References
• https://vuejs.org/v2/guide/
• https://www.devmedia.com.br/vue-js-tutorial/ 38042
• https://www.shopify.com/partners/blog/vuejs- tutorial
• https://github.com/vuejs-templates/webpack
• http://www.vuejs-brasil.com.br/crie-rapidamente-um-projeto-vue-com-vue-cli-e-browserify/
• https://medium.com/@thiagorossener/como-fazer- um-hello-world-com-vue-js-2-62ea708c1399
References
• http://vegibit.com/vue-js-directives/
• https://alligator.io/vuejs/rest-api-axios/
• https://www.thepolyglotdeveloper.com/2017/10/ consume-api-data-http-vuejs-web-application/
• https://medium.com/codingthesmartway-com- blog/vue-js-2-state-management-with-vuex- introduction-db26cb495113
• https://vuejsdevelopers.com/2017/04/01/vue-js- prerendering-node-laravel/