An electronic device may include a
mobile phone, a
tablet computer, a handheld computer, a walkie-talkie, a POS
machine, an
event data recorder, a wearable device, a
virtual reality device, or in-vehicle original equipment or another terminal product with a
loudspeaker. An inner wall of a mounting cavity for mounting a
loudspeaker and the
loudspeaker are respectively provided with
mating surfaces that adapt to each other. In the two
mating surfaces, one is provided with a flexible sealing member and a limiting structure, and the other is provided with a rigid sealing member. When the loudspeaker is mounted, the rigid sealing member can move relative to the flexible sealing member along a first direction, until the rigid sealing member is mated with the flexible sealing member. The limiting structure can
restrict the flexible sealing member from moving.