There was a time, early in her vice presidency, when Kamala Harris, aware of reams of conservative news coverage criticizing her laughter, privately wondered to confidants whether she should laugh, or show a sense of humor, at all.

They reassured her that she should, according to two people familiar with the discussions at the time. Still, Ms. Harris proceeded gingerly, embarking on a run of tightly controlled appearances. She focused on issues like abortion rights and worked to bolster her foreign policy chops. She took emotionally resonant trips during which she carefully honed her image. Along the way, laughter never really left her.

So it is no accident that joy — a battle-tested version of it — has become the backbone of Ms. Harris’s campaign in recent days.

“The thing we like about hard work is we have fun doing hard work,” she said at a campaign event with autoworkers on Thursday in Wayne, Mich. “Because we know what we stand for. When you know what you stand for, you know what you fight for.”

Her running mate of three days, Gov. Tim Walz of Minnesota, is ad-libbing many of the compliments he gives Ms. Harris on the campaign trail as he tries to strike a contrast with what he casts as the gloomy vision of former President Donald J. Trump and other Republicans.

“The one thing I will not forgive them for is they try to steal the joy from this country,” Mr. Walz, who has so far presented himself as something of a walking bear hug, said on Wednesday in Detroit. “But you know what? Our next president brings the joy. She emanates the joy.”