Addressing the pressing and significant issue of reducing greenhouse gas emissions in our society, it is crucial to develop environmentally sustainable materials for carbon dioxide adsorption. In this work, we propose a straightforward and effective method, that is, in situ growth of covalent organic frameworks (COFs) on a polyacrylonitrile (PAN) nanofiber substrate using a reversible polycondensation termination technique and successfully prepare flexible COF nanofiber membranes