- Install VueJS
- VueInstance
- Data & Method
- Data binding
- v-bind:href=
- v-bind:target=
- v-bind:class=
- v-bind:style=
- v-bind:key=
- JavaScript Expression
- Event Handling
- v-on:click
- v-on:mouseMove
- v-on:submit
- v-on:submit.prevent (Ngan chan) || event.preventDeaufaul()
- event.target
- v-on:mouseMove.stop || event.stopPropagation() (Dung su lan tu con ra cha)
- v-on:keyup
- Computed
- Two-way Data Binding
- v-model=
- Conditional Rendering (Bieu thuc dieu kien)
- v-if=
- v-else=
- v-elst-if=
- v-show=
- key=
- List Rendering
- v-for=
- Note about Array and Object
- vueInstance.$set(target, key, value)
Ex:
- with Array: vueInstance.$set(vueInstance.arrNumber, 0, 2019)
- with Object: vueInstance.$set(vueInstance.objScore, "englis", 9)
- vueInstance.$set(target, key, value)
Ex:
- Raw HTML
- v-html=
- Structure in the Project
- Environment
- Development
- Babel --> A JavaScript Compiler
- Webpack --> Tool giup dong goi code, dong goi ma nguon
- Production
- Development
- Environment
- Props
- Nhung data truyen tu Component cha vao Component con -> Cu phap giong thuoc tinh -> Rang buoc attribute -> Use v-bind:
- Props Down -> Truyen du lieu tu cha vao con --> Thang con chi used, khong duoc change truc tiep
- Event
- Event Up -> Truyen thong diep (Thong diep event) thong bao cho Component cha know it want change data -> Task of Component cha la nhan duoc thong diep va tien hanh change data -> Custom Event in VueJS
- Custom Events
- Reference
- Tham chieu toi HTML elements
- Slot
- Cau truc HTML elements in Component tag