Currently, a fingerprint recognition function is more popular in a handheld electronic device such as a mobile phone or a tablet computer. With a fingerprint recognition module mounted on an electronic device, the electronic device can recognize a user's fingerprint, thereby improving security of the electronic device. However, because existing handheld electronic devices favor light and thin designs, a waterproof design for the fingerprint recognition module becomes a difficulty. As shown in FIG. 1, in the prior art, a groove (6) is opened on a housing of an electronic device, a fingerprint recognition module (5) is placed in the groove (6), and the groove (6) is stuffed with a waterproof adhesive layer, so that the entire fingerprint module of the electronic device is protected and isolated from other components of the electronic device. However, in this design solution, a structure of a mobile phone needs to be changed. If a size of the fingerprint module changes, the structure of the mobile phone needs to be designed again. Consequently, compatibility with mass production is lacking, a machining process is complex, adhesive needs to be dispensed on a plurality of positions, space for the fingerprint module is enlarged, and the mobile phone cannot be thin or light.