Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/StudentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function save_student()

public function all_students()
{
$students = Student::paginate(5);
$students = Student::orderBy('created_at', 'desc')->paginate(5);
return response()->json($students);
}

Expand Down
22 changes: 15 additions & 7 deletions public/note
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ vue router = router
+v-on:[ten su kien]="sgtregre"
viet tat: v-on:click -> @click
+Prevent default event:
+ huy bo event mac dinh cua element di -> lamf tiep cai gi do theo y thich
+ huy bo event mac dinh cua element di -> lam tiep cai gi do theo y thich
https://viblo.asia/p/bai-14-event-handling-voi-vuejs-3P0lPze8Kox

+ ref:
Anh xa den chinh element
Expand All @@ -40,30 +41,37 @@ vue router = router
+v-for

+methods:
+function cua vue object
+function cua vue object (là danh sách các phương thức của component)

+watch
Thao doi su thay doi cua data
+watch (watcher)
Theo doi su thay doi cua data
Với việc sử dụng watch có thể giúp chúng ta theo dõi sự thay đổi và sau đó thực hiện những tính toán phức tạp

+hood:
mounted
created: thường dùng để gọi API lấy dữ liệu từ server, khởi tạo websocket, lắng nghe event Laravel Echo,... miễn là ta không động gì vào DOM thật là được

Props:
mounted: đưa component ra trình duỵet

+Props:
Dua du lieu day tu component cha sang component con
Cach khai bao:
+dung mang ten cac prop
+dungf object

Props =data

Event:
+Lí do vì sao không dùng JQuery được ở created: Vì ở created là ta mới chỉ có DOM ảo được tạo ra, mà jquery thì chỉ thao tác được với DOM thật, do đó nên nếu muốn dùng JQuery ta cần làm ở mounted (khi DOM ảo đã được đồng bộ với DOM thật)

filter:
bien doi du lieu truoc khi no dc render

https://stackoverflow.com/questions/149055/how-to-format-numbers-as-currency-string
https://www.youtube.com/watch?v=j97QtHf0CHY&t=882s

+scoped:
https://viblo.asia/p/bai-15-scoped-css-trong-vuejs-va-cac-ki-thuat-lien-quan-63vKjakd52R


pagination laravel vue: https://github.com/gilbitron/laravel-vue-pagination

https://viblo.asia/p/restful-api-trong-laravel-cho-nguoi-moi-bat-dau-ByEZkNaqKQ0
Expand Down