There are many reasons for a dog having the above symptoms.
First of all, if the dog vomits only after eating certain foods, the primary consideration is that the food is more irritating, and Wokeepet recommends feeding easy-to-digest, low-irritating foods.
Secondly, suppose the dog vomits whenever it eat any food. In that case, you generally consider the possibility of gastrointestinal infection and other diseases, and a foreign body may also cause it in the intestine.
It is recommended to consult a veterinarian in time.