Vue.js
Contents
2019 Tech Stack
Vue.js
Component templates
- Computed property - double mustache inside the component template
- Components have templates, script, and styling
Directives
- directive inside HTML tags start with v-
v-bind:____="someDataStoreObj
- bind keeps something up-to-date with some data store propertyv-if="varName"
v-for:"i in datastoreobj"
v-on:click="someMethod"
- binds a function to button<input v-model="message">
- direct two-way binding between input and app state
Vue Instance
Vuex
- Single state tree - single source of truth
Vue Router
- Single page App
- In index.js, after imports, add
Vue.use(Router)
- In App.vue, add
<router-view/>
tag.
Vue CLI
npm install -g @vue/cli
vue --version
vue ui
- Create new project, include vuex and vue router components
- Run Project task 1: serve
- Run Project task 2 (build):
2018 Tech Stack
- container
- nginx
- node.js
- TypeScript lang
- React & webpack + TypeScript