I would have her checked out - there is something called cyclic vomiting syndrome and it can have various causes. It sounds like your daughter is doing this when she is upset about something else BUT in case she is first feeling ill and THEN gets upset and vomits, you should rule this out. I would be very cautious if the doctor starts throwing meds at you - so many kids are being given meds for reflux and other things when it's not really necessary. There are drug-free nutritional approaches that adjust the diet before going into medications, especially in one so young. Many meds cause other problems even if they help improve a symptom. Meds are not usually CURING something as much as MASKING the symptom. I have many friends who have gone this route with a particularly effective nutritional supplement. A friend of mine is a pharmacist, her daughter had chronic vomiting syndrome, and she had to really push push push to get the right tests. They didn't do them all, she was medicated inappropriately, and underlying cause was missed.
If it's not physical, then it can be emotional or psychological. If not paying much attention to the vomiting has a positive effect, then that will tell you a lot. Don't be afraid to investigate these options!
I think it is really important that you not blame yourself for this problem, whatever the cause, and think that there is something you are "doing wrong as a parent"! You are like all of us - your kid is doing something odd and you are reaching out to find a solution. Different factors are in play and that doesn't make it your fault!