The states may apportion their electors in whichever way their respective legislatures decide. In the first several elections, quite a few states’ legislatures cast their votes without taking any kind of popular vote. South Carolina didn’t have a popular vote for presidential electors until Reconstruction.
Maine and Nebraska presently award one electoral vote to the winner of the popular vote in each of their congressional districts and their remaining two electoral votes to the winners of their state-wide tallies. It was common in the Early Republic for electoral votes to be allocated that way.