A lock comprising: a housing having an installation recess and an insertion hole defined in an underside thereof, a flat face and a protrusion formed on the underside of the housing, the protrusion being higher than the flat face and having a first end face; a pivot configured to be located in the insertion hole and having a first end and a second end, a slide configured to be connected to the second end of the pivot; a spring configured to be located in the insertion hole and configured to apply a first resilient force toward the insertion hole and a second resilient force toward a direction that the slide pivots, a first end of the spring capable of being fixed in the insertion hole and a second end of the spring configured to be connected to the pivot, and when the slide is located at a first position, the slide is applied by the first resilient force of the spring and located on the flat face, the slide is applied by the second resilient force of the spring to cover the installation recess, when the slide is located at a second position, the slide is pivoted to overcome the second resilient force of the spring and has at least one portion thereof not covering the installation recess, when the slide is located at a third position, the slide is pivoted and the pivot moves axially to compress the spring and to overcome the first resilient force of the spring, the slide is located above the first end face of the protrusion and continuously pivoted, and at least one portion of the slide does not cover the installation recess, wherein the spring has a second leg on the second end thereof, the pivot has a slot defined in the first end thereof, the second leg is configured to be engaged with the slot to fix the spring to the pivot, and wherein the slot includes a radial hole defined radially in the first end thereof, a pin configured to extend through the radial hole, the second leg is configured to be restricted between an inner end of the slot and the pin. a housing having an installation recess and an insertion hole defined in an underside thereof, a flat face and a protrusion formed on the underside of the housing, the protrusion being higher than the flat face and having a first end face; a pivot configured to be located in the insertion hole and having a first end and a second end, a slide configured to be connected to the second end of the pivot; a spring configured to be located in the insertion hole and configured to apply a first resilient force toward the insertion hole and a second resilient force toward a direction that the slide pivots, a first end of the spring capable of being fixed in the insertion hole and a second end of the spring configured to be connected to the pivot, and when the slide is located at a first position, the slide is applied by the first resilient force of the spring and located on the flat face, the slide is applied by the second resilient force of the spring to cover the installation recess, when the slide is located at a second position, the slide is pivoted to overcome the second resilient force of the spring and has at least one portion thereof not covering the installation recess, when the slide is located at a third position, the slide is pivoted and the pivot moves axially to compress the spring and to overcome the first resilient force of the spring, the slide is located above the first end face of the protrusion and continuously pivoted, and at least one portion of the slide does not cover the installation recess,