An electronic device, comprising at least one camera module, the camera module comprises a casing, a fastening bracket, a lens assembly, a first driving component, a second driving component, and an image sensor component, wherein a mounting hole is disposed on one side surface of the casing, the lens assembly is partially accommodated in the casing by using the mounting hole, the fastening bracket is disposed in the casing, the image sensor component is located at the bottom of the casing, the fastening bracket comprises a first fastening part and a second fastening part, the first fastening part is sleeved outside the lens assembly, one end of the second fastening part is connected to a side that is of the first fastening part and that faces the bottom of the casing, the other end of the second fastening part is supported on an inner bottom wall of the casing, and at least one magnetic component is fastened to an inner edge of the first fastening part; and the first driving component is located on the side that is of the first fastening part and that faces the bottom of the casing, one side surface of the first driving component faces one part of the magnetic component, the other side surface of the first driving component is connected to the image sensor component, the magnetic component is configured to drive the first driving component to move, the second driving component is sleeved on an outer wall of the lens assembly, the second driving component faces the other part of the magnetic component, and the magnetic component is configured to drive the second driving component to move; characterized in that the first driving component comprises a support plate and at least one first driving coil, the first driving coil is disposed on a side surface that is of the support plate and that faces the magnetic component, and the first driving coil is opposite to the magnetic component, wherein at least one first limiting part is disposed on the first fastening part, at least one second limiting part is disposed on a side that is of the support plate and that faces the first fastening part, the second limiting part is opposite to the first limiting part, a ball is disposed between the first limiting part and the second limiting part, and the first limiting part and the second limiting part are in contact with each other by using the ball. the first driving component is located on the side that is of the first fastening part and that faces the bottom of the casing, one side surface of the first driving component faces one part of the magnetic component, the other side surface of the first driving component is connected to the image sensor component, the magnetic component is configured to drive the first driving component to move, the second driving component is sleeved on an outer wall of the lens assembly, the second driving component faces the other part of the magnetic component, and the magnetic component is configured to drive the second driving component to move; characterized in that the first driving component comprises a support plate and at least one first driving coil, the first driving coil is disposed on a side surface that is of the support plate and that faces the magnetic component, and the first driving coil is opposite to the magnetic component, wherein at least one first limiting part is disposed on the first fastening part, at least one second limiting part is disposed on a side that is of the support plate and that faces the first fastening part, the second limiting part is opposite to the first limiting part, a ball is disposed between the first limiting part and the second limiting part, and the first limiting part and the second limiting part are in contact with each other by using the ball.