Cu2+ detection was performed by taking advantage of the fluorescence quenching ability of graphdiyne and the high specificity of click chemistry.