Vue components giao tiếp qua nhiều cơ chế tùy quan hệ và chiều dữ liệu.
- Props (parent → child): dữ liệu đi xuống, one-way
- Emits (child → parent): event đi lên, gọi
emit() - v-model: two-way binding, kết hợp props + emits
- provide/inject: ancestor → descendant, bỏ qua intermediaries
- Pinia (recommended) hoặc Vuex (legacy): global state store cho app-wide state
- Event bus (ít dùng trong Vue 3):
mittlibrary
Pitfall: tránh emit từ child để trực tiếp modify prop của parent — luôn emit event để parent tự update.