We report a wavelength-locked cladding-pumped ytterbium-doped fiber laser that can simultaneously emit radially and azimuthally polarized beams based on Pancharatnam-Berry phase optical elements. Multi-wavelength free running operation of the radially and azimuthally polarized laser beams can be switched to a single-wavelength one assisted by volume Bragg grating, with wavelength locked at around 1053.4 nm and spectral linewidth of 0.06 nm (FWHW). By rotating the glan-taylor polarizer, we can obtain switchable radially and azimuthally polarized beams output. The radially and azimuthally polarized beams mode purity can maintain 97.3% and 96.3% at maximum output power, and the polarization extinction ratio (PER) can reach 97.8% and 95.9% for the radially and azimuthally polarized laser, respectively.