β-Lactoglobulin (β-Lg), a food allergen, can easily cause allergic reactions in infants and young children. Therefore, it is necessary to develop a rapid, sensitive, and selective detection method to protect individuals prone to allergies. In this paper, a fluorescence assay based on WS2 nanosheets and a fluorescent dye (FAM)-labeled β-Lg aptamer was designed to detect β-Lg rapidly with high sensitivity. In the sensing platform, the β-Lg aptamer is adsorbed on the WS2 nanosheet surface by van der Waals forces, which trigger the phenomenon of fluorescence resonance energy transfer (FRET) and suppress the fluorescence signal in the system. When β-Lg is present, the conformation of the aptamer specifically bound to β-Lg changes. Therefore, the aptamer is separated from the WS2 nanosheet surface, and the fluorescence signal is recovered. This method combines the high quenching efficiency of WS2 nanosheets and good specificity of the β-Lg aptamer. The detection range of this method for β-Lg is 0.1-100 μg mL-1. The detection limit is 20.4 ng mL-1. This method exhibits high sensitivity, selectivity and good reproducibility, and it can be used for β-Lg detection in actual samples.