Vardy struck home from close range after good work from David Nugent, but Keith Hill's side deserved the plaudits after a battling show.
Barnsley could have been one down within two minutes of the start. John Stones impeded Lloyd Dyer and from the resultant free-kick, Tykes keeper Luke Steele tipped Waghorn's shot around a post.
A goal looked inevitable even at this early stage and it duly arrived after nine minutes when Anthony Knockaert drilled home left footed from 12 yards to give the overworked Steele no chance with his fifth goal of the season.
It had been an early procession towards the Tykes' goal and the Yorkshiremen were finding it hard to gain any sort of foothold in the match as Nigel Pearson's promotion hopefuls ran them ragged.
But eventually Hill's men made their presence felt with a series of zealous challenges intended to disrupt the rhythm of the impressive hosts.
It worked, and Barnsley drew level after 27 minutes when Stephen Dawson struck beyond Kasper Schmeichel to make it 1-1 from 12 yards.
The goal gave the visitors the lift they needed but it also stung the Foxes into renewed action, Dyer trying his luck from inside the box and seeing his effort clear the crossbar.
But if Leicester had been rattled by the equaliser, they were left distraught after conceding a second after 39 minutes.
This time it was Reuben Noble-Lazarus who finished off a move involving Jim O'Brien with a stylish overhead kick from close range to put his side 2-1 ahead.
Another Waghorn effort from distance was well held by Steele but at the other end Akos Buzsaky shot wide when well placed to add to the Tykes' tally just a minute from the break.
Leicester knew they had to up the tempo after the break and Knockaert went close, first with his right boot and then with his head after 58 minutes, his 12-yard effort just clearing the crossbar as the Foxes forced the pace.
Waghorn then made way for Vardy, who turned into Leicester's saviour.