This study demonstrates a significant impact of green environments on myopia in children and adolescents aged 3~20 years, revealing the potential mediating effect of outdoor activities. Policymakers should consider implementing intervention measures to enhance green spaces in schools to promote eye-health-friendly environments.