We propose a vortex beam generator based on a nanometer spiral slit and explore the propagation rule of the topological charge. Compared to the common methods of generation of a vortex beam with a fixed topological charge, the optical vortex generated by the proposed vortex beam generator has the topological charge varying with the propagation distance. The value of topological charge can be modulated by the geometric charge of the spiral slit and the propagation distance. Theoretical analysis predicts the variation rule of the topological charge of vortex beam in the near field, and numerical simulations and experimental measurement verify the proposed scheme. Discussion on the shape and structure of the spiral slit is also presented. This work provides the theoretical foundation for the generation of a vortex field with variable topological charge. The simple geometry of the vortex beam generator and the flexible modulation of the topological charge must inspire applications of the vortex beam.