The wetting and spreading of droplets on solid walls are commonly seen in nature. The study of such a phenomenon can deepen our understanding of solid-liquid interaction and promote the development of relevant cutting-edge technological applications. In this work, the lattice Boltzmann method based on phase field theory is used to investigate the wetting and spreading of a compound droplet on a wedge. This method combines the finite-difference solution of the Cahn-Hilliard equations for ternary fluids to capture the interface dynamics and the lattice Boltzmann method for the hydrodynamics of the flow. Symmetric compound droplets with equal interfacial tensions on a wedge are considered first. Through theoretical analysis and numerical simulation, it is found that the wetted area on the wedge increases with the decrease of the contact angle of the wedge surface and the wedge apex angle. Depending on these two factors, the droplet may or may not split on the wedge. We also find that the droplet near the critical state predicted not to split by static equilibrium analysis could split during the spreading along the wall of the wedge under certain density and viscosity ratios. Based on the simulation results, a phase diagram of the droplet splitting state is generated with the density ratio and viscosity ratio as the coordinates. As the density ratio and kinematic viscosity ratio increase, the inertia effect becomes more prominent in the wetting and spreading process and the droplet is more likely to split. By comparing the phase diagrams in different initial conditions, it is found that under the same conditions, the compound droplet with an equilibrium initial state is less likely to split than that with an unequilibrium initial state, which is possibly because the initial total energy of the former is relatively small. Our study also shows that the kinematic viscosity ratio between the left half and the right half droplet may affect the results of droplet splitting. The increase of such a viscosity difference is conducive to the splitting of the compound droplet. Besides, asymmetric compound droplets with unequal interfacial tensions are also simulated, and it is found that the greater the wrapping degree between the left half and right half, the more difficult it is to separate the compound droplet.