Please enable JavaScript.
Coggle requires JavaScript to display documents.
Vuejs (Vuex (store (Vuex API (this.$store.commit('change',value),…
Vuejs
Vuex
-
-
-
-
-
-
-
store
-
-
-
-
add to vue app by: store in the root instance => the store will be injected into all child component of the root and call by this.$store
Vuex API
this.$store.commit('change',value)
-
-
-
-
-
-
-
-
-
-
-
Component
Vue.component('product', {
props: [message],
template: <div> {{message}}</div>
,
data() {...}
props recommend:
props: {
message: {
type: String,
required: true,
default: "hi"}},
-
Comunicating Events
Child: addToCart(){
this.$emit('add-to-cart',param)}
-
Lifecycle Hooks
mounted()
-
Most used: fetching data for compo(use created for this instead), and modify the DOM
Router
Lazy load routes
-
Check tab network + JS
-
It's better to split our bundle into mulitple smaller files => called chunks or bundles: Code Splitting
-
Dynamic imports: The import statement will only be executed when arrow function is called => lazy loading the component
-