Oh how I remember Stella doing this! And she also added rock eating while walking too! I used to bring another toy, treat, or stick or whatever with us and tried to redirect her to that object. It took time but eventually she stopped all the leash/leg biting. But even now at 17 months, if she gets real excited, she will start playing tug with the leash. Then I just tell her "no leash" and she stops.