Q. Dog throwing up white mucus with white bits
A. If he has only vomited once or twice, I recommend withholding food for 12-24 hours. This will give the gut a chance to rest. Let her have water, ice cubes to lick if she seems to want to gulp the water. After 12-24 hours, give her a tiny amount of her regular food, and wait for 30 minutes. If she eats it and it stays down, repeat the small amount. If all continues to go well, keep feeding her very small amounts until she has had her normal ration. If, however, she does not want to eat, continues to vomit, develops a fever and/or lethargy, get her in to see your vet or to an emergency clinic right away.
If he has been vomiting multiple times over several hours, he should be seen by a vet as soon as possible. Continued vomiting is very concerning and can lead to dehydration and electrolyte imbalance as well as low blood sugar. He might have eaten something that either disagreed with him or something that has gotten stuck somewhere in his gastrointestinal tract. He could be sore from a hidden injury you are unaware of, he could have been exposed to some sort of toxin or irritant in his environment or this could be early signs of another condition or disease process.