Any long time working of eyes can cause eye strain, which is not good for eyes. Basically, knitting would not damage your vision. But if you knit for a long period of time, you might feel uncomfortable. Because knitting is meticulous, you have to stare at avoid mistakes. The common symptoms of eye strain are blurred vision, dry eye and even sick.
My suggestion are knitting in the appropriated lighting and taking frequent rest.
Yeah, too much time of knitting with little rest is bad for your eyes. When you are knitting, the eye nerves are in the nervous state, with the eye muscles tight all the time. If you keep on doing this, the eye muscles can't get the rest which will make it hard to come back to the normal state. Thus, it will cause the eyes dry and dizzy. You'd better keep the good habit of resting for a while, in case of the tiredness.