Light-degradable hydrogels have a wide range of application prospects in the field of biomedicine. However, the provision of a facile synthetic approach to light-degradable hydrogels under mild conditions remains a challenge for researchers. To surmount this challenge, a facile synthetic approach to UV-degradable hydrogels is demonstrated in this manuscript. Initially, an UV-degradable crosslinker (UVDC) having o-nitrobenzyl ester groups was synthesized in a single step through the employment of the Passerini three-component reaction (P-3CR). Both 1H NMR and MS spectra indicated the successful synthesis of high-purity UVDC, and it was experimentally demonstrated that the synthesized UVDC was capable of degradation under 368 nm light. Furthermore, this UVDC was mixed with 8-arm PEG-thiol (sPEG20k-(SH)8) to promptly yield an UV-degradable hydrogel through a click reaction. The SEM image of the fabricated hydrogel exhibits the favorable crosslinking network of the hydrogel, proving the successful synthesis of the hydrogel. After continuous 368 nm irradiation, the hydrogel showed an obvious gel-sol transition, which demonstrates that the hydrogel possesses a desirable UV-degradable property. In summary, by utilizing solely a two-step reaction devoid of catalysts and hazardous raw materials, UV-degradable hydrogels can be obtained under ambient conditions, which greatly reduces the difficulty of synthesizing light-degradable hydrogels. This work extends the synthetic toolbox for light-degradable hydrogels, enabling their accelerated development.