An electronic component with an enclosure frame, comprising: the enclosure frame, wherein the enclosure frame defines a cavity; when the electronic component with an enclosure frame is connected to a circuit board, the enclosure frame and the circuit board can define a cavity that is closed or that has one open end; or when the electronic component with an enclosure frame is connected to a circuit board, the enclosure frame and another enclosure frame of another electronic component with the another enclosure frame can define a cavity that is closed or that has one open end; or when the electronic component with an enclosure frame is connected to a circuit board, the enclosure frame, the circuit board, and another enclosure frame of another electronic component with the another enclosure frame can define a cavity that is closed or that has one open end; and an electronic component, wherein the electronic component comprises an electronic component body and a pin; at least a first end of the electronic component body is located inside the enclosure frame; the electronic component body is fastened to the enclosure frame; the pin extends out of the electronic component body from the first end of the electronic component body, and extends out of the enclosure frame from a first end of the enclosure frame; and a part that is of the pin and that is located between an end face of the first end of the electronic component body and an end face of the first end of the enclosure frame is located inside the enclosure frame, characterized in that the enclosure frame comprises a plurality of side walls, the plurality of side walls define a cylindrical structure with two open ends opposite to each other, and a first open end of the cylindrical structure is the first end of the enclosure frame; and the electronic component body is fastened to a side wall, the end face of the first end of the electronic component body faces towards an opening in the first open end of the cylindrical structure, and the pin extends out of the electronic component body from the first end of the electronic component body, and extends out of the enclosure frame from the opening in the first open end of the cylindrical structure. the enclosure frame, wherein the enclosure frame defines a cavity; when the electronic component with an enclosure frame is connected to a circuit board, the enclosure frame and the circuit board can define a cavity that is closed or that has one open end; or when the electronic component with an enclosure frame is connected to a circuit board, the enclosure frame and another enclosure frame of another electronic component with the another enclosure frame can define a cavity that is closed or that has one open end; or when the electronic component with an enclosure frame is connected to a circuit board, the enclosure frame, the circuit board, and another enclosure frame of another electronic component with the another enclosure frame can define a cavity that is closed or that has one open end; and an electronic component, wherein the electronic component comprises an electronic component body and a pin; at least a first end of the electronic component body is located inside the enclosure frame; the electronic component body is fastened to the enclosure frame; the pin extends out of the electronic component body from the first end of the electronic component body, and extends out of the enclosure frame from a first end of the enclosure frame; and a part that is of the pin and that is located between an end face of the first end of the electronic component body and an end face of the first end of the enclosure frame is located inside the enclosure frame, characterized in that the enclosure frame comprises a plurality of side walls, the plurality of side walls define a cylindrical structure with two open ends opposite to each other, and a first open end of the cylindrical structure is the first end of the enclosure frame; and the electronic component body is fastened to a side wall, the end face of the first end of the electronic component body faces towards an opening in the first open end of the cylindrical structure, and the pin extends out of the electronic component body from the first end of the electronic component body, and extends out of the enclosure frame from the opening in the first open end of the cylindrical structure.