A law allowing battered women leaving shelters to live in public housing for at least two years has passed a preliminary vote.