A handheld vacuum cleaner, comprising a frame, and a dust barrel and a locking portion mounted on the frame, wherein a front end of the dust barrel and the locking portion are movable relative to each other and are arranged opposite to each other, the dust barrel has a rotatable front cover at a front side thereof; and when the locking portion and the dust barrel move with respect to each other, the front cover is automatically rotatable to open, or close on the front side of the dust barrel due to limit by the locking portion; characterized in that a lower end of the front cover is hinged to a lower end of the front side of the dust barrel by means of a rotating member; the rotating member comprises a connecting shaft, a fixed sleeve mounted around the connecting shaft, and a torsional spring embedded within the fixed sleeve and mounted around the connecting shaft; edges of the lower ends of the front cover and the dust barrel are coaxially connected by the connecting shaft; the fixed sleeve is snapped onto the dust barrel; and one end of the torsional spring abuts against an outer edge of the front cover and provides the front cover with a rotating force relative to the dust barrel; and further characterized in that a rear end of the dust barrel is connected with an electric fan assembly, a rear end of the electric fan assembly is hinged on the frame, and a front end of the dust barrel is rotatable around a hinged end of the electric fan assembly to be disengaged from a locking position of the locking portion, so that the front cover is automatically opened; or the dust barrel is fixedly mounted on the frame, a lower end of the locking portion is hinged on the frame and the locking portion is rotatable to open relative to the frame; after the locking portion is rotated, the front cover of the dust barrel is automatically rotated and opened, and after the locking portion is reset in position, the front cover is driven by the locking portion to close and to be covered on a front end of the dust barrel; or the locking portion is fixedly mounted on a front end of the frame, and the dust barrel is mounted on the frame and is liftable by a lifting member, and after the dust barrel is lifted, the front cover of the dust barrel is released from a locking position of the locking portion and automatically rotated and opened. a lower end of the front cover is hinged to a lower end of the front side of the dust barrel by means of a rotating member; the rotating member comprises a connecting shaft, a fixed sleeve mounted around the connecting shaft, and a torsional spring embedded within the fixed sleeve and mounted around the connecting shaft; edges of the lower ends of the front cover and the dust barrel are coaxially connected by the connecting shaft; the fixed sleeve is snapped onto the dust barrel; and one end of the torsional spring abuts against an outer edge of the front cover and provides the front cover with a rotating force relative to the dust barrel; and further characterized in that a rear end of the dust barrel is connected with an electric fan assembly, a rear end of the electric fan assembly is hinged on the frame, and a front end of the dust barrel is rotatable around a hinged end of the electric fan assembly to be disengaged from a locking position of the locking portion, so that the front cover is automatically opened; or the dust barrel is fixedly mounted on the frame, a lower end of the locking portion is hinged on the frame and the locking portion is rotatable to open relative to the frame; after the locking portion is rotated, the front cover of the dust barrel is automatically rotated and opened, and after the locking portion is reset in position, the front cover is driven by the locking portion to close and to be covered on a front end of the dust barrel; or the locking portion is fixedly mounted on a front end of the frame, and the dust barrel is mounted on the frame and is liftable by a lifting member, and after the dust barrel is lifted, the front cover of the dust barrel is released from a locking position of the locking portion and automatically rotated and opened.