Droplet-based microfluidics has gained extensive research interest as it overcomes several challenges confronted by conventional single-phase microfluidics. The mixing performance inside droplets/slugs is critical in many applications such as advanced material syntheses and in situ kinetic measurements. In order to understand the effects of operating conditions on the mixing performance inside liquid slugs generated by a microfluidic T-junction, we have adopted the volume of fluid method coupled with the species transport model to study and quantify the mixing efficiencies inside slugs. Our simulation results demonstrate that an efficient mixing process is achieved by the intimate collaboration of the twirling effect and the recirculating flow. Only if the reagents are distributed transversely by the twirling effect, the recirculating flow can bring in convection mechanism thus facilitating mixing. By comparing the mixing performance inside slugs at various operating conditions, we find that slug size plays the key role in influencing the mixing performance as it determines the amount of fluid to be distributed by the twirling effect. For the cases where short slugs are generated, the mixing process is governed by the fast convection mechanism because the twirling effect can distribute the fluid to the flow path of the recirculating flow effectively. For cases with long slugs, the mixing process is dominated by the slow diffusion mechanism since the twirling effect is insufficient to distribute the large amount of fluid. In addition, our results show that increasing the operating velocity has limited effects on improving the mixing performance. This study provides the insight of the mixing process and may benefit the design and operations of droplet-based microfluidics.