Metal-free carbon quantum dots (CQDs) have attracted great interest, but the rapid preparation of doped CQDs with tunable optical properties is still an urgent task. Herein, we report that covalent organic frameworks (covalent triazine-based frameworks, CTF-1) with layered structures can be rapidly exfoliated and cut into N-doped CQDs. The cutting mechanism involves triazine hydrolysis and breaking the bonds between the triazines and benzene rings. Experiments and density functional theory (DFT) calculations confirm that the fluorescence of the obtained CQDs mainly originates from the intrinsic state emission induced by localized pi-pi* transitions, despite the contribution of the defect state emission. Due to their unique chemical structure, the CQDs could be further utilized as an efficient PL probe for detecting Hg2+. This study may open up new avenues for developing new kinds of CQDs using covalent organic frameworks as the starting materials.