I think she is simply doing it for your attention. Just remember she is still a baby and needs a lot of your attention. Just be patient. You can start confining her for short periods of time and see how she does. Then start leaving her for longer and longer periods of time.
I remember with my lil Romeo, he hated to be in his crate, but overtime got used to it. He would bark and whine but you have to let them know who's boss early on. Everytime she does something you don't like, place her in her crate and overtime she will stop doing it. These yorkies are very smart.
I wouldn't recommend flicking or hitting them even if its gently. You're never required to get physical with them.
Let me know if you have any other concerns, we are here to help