The precise synthesis of Cu NCs is a highly desirable and controllable route for the preparation of desired structures and properties, which facilitates the rational design of valuable probes for fluorescence sensing and the understanding of structure-property relationships. Herein, an ion-exchange strategy combined with a bottom-up synthetic approach was utilized in the synthesis process of Cu NCs for the first time, which achieved the controllable synthesis of Cu NCs and in situ anchoring of Cu NCs on the support material HPU-14. The as-prepared Cu NCs@HPU-14-4h not only had a good peroxidase-like property but also exhibited stable dual-emitting fluorescence at 470 and 620 nm. Notably, the peroxidase-like property endowed Cu NCs@HPU-14-4h with the capability of highly sensitive colorimetric detection of H2O2 in a linear concentration from 0.1 to 140 μM (detection limit of 86.7 nM), and a change in the fluorescent color from red to blue could be observed by the naked eye. Furthermore, due to the large overlap between the absorption of 2,4,6-trinitrophenol (TNP) and the excitation band of Cu NCs@HPU-14-4h, TNP could also be detected from 27 types of analogs and common ions with a limit of detection of 68 nM. Finally, a portable hydrogel probe with efficient wipe sampling was fabricated by polyvinyl alcohol (PVA) comprising Cu NCs@HPU-14-4h with the aim of on-site visualization of different explosives. Consequently, the current study not only provides a new idea for the precise synthesis of Cu NCs and their controllable anchoring on support materials but also offers an effective method for predicting H2O2 and TNP.