After dynamically updating the vertices of lineGeometry of Line2, line segment colors are not displayed

I solved this problem by looking at this post, if you have the same problem as me, I hope it can help you