The list of reasons why a dog may vomit is huge and many are related to various diseases and illnesses. However, the most common reason is something they ate, as a result of physical composition or drug/poison based. Dogs are often indiscriminate in what they'll eat, and swallow, and the result of this can be vomiting or more serious problems.
I think, at this point, I would strongly recommend that you bring her to the vet for an examination. The fact that she's both vomiting and struggling to defecate signals, to me at least, a serious problem which could be an injury or worse. There's really no way to tell without the examination.
It could be something she ate or she may have developed a food intolerance (very real possibility), and so easy to resolve, but that's still going to need veterinary confirmation.