Ground-state properties of interacting two-component Bose gases in a one-dimensional harmonic trap