Dog suddenly aggressive?

I have a 12 year old Chihuahua mix. I’ve had her for 7 years. She recently started becoming aggressive. I have a 1 and 2 year old and if they walk past her, she growls and tries to bite them. Also, she was laying on a pillow and my son touched the pillow and she growled at him, he didn’t even touch her. That being said, the other day it was late at night and we were sleeping, kids in bed with us, and she started growling and snapping at what I assume was nothing. She’s never been like this. She would growl in the past if my kids were rough with her but that’s it. I’m wondering if maybe she’s having trouble with her eyesight so she’s being aggressive? What else could cause this?