With the rapid progress of electronic technology, more and more electronic devices are developing in the direction of thin, flexible and wearable. One of the biggest challenges in the development of wearable electronic devices is to adapt safe and flexible electrochemical energy storage devices. Flexible zinc/magnesium ion batteries have the advantages of high safety and environmental friendliness, and are considered to be the ideal power source for wearable electronic devices. Hydrogels are ideal electrolytes for flexible batteries due to their combination of flexibility and ion conduction. However, traditional hydrogel electrolytes only serve as a physical framework for ion transport, and their limitations are becoming increasingly prominent. Therefore, it is important to design functional hydrogel electrolytes, which can not only improve the electrochemical performance of flexible zinc-ion batteries, but also ensure their stable operation under extreme conditions such as cold, stretching and bending.