The Word of Wisdom is a law of health for the physical and spiritual benefit of God’s children. It includes instruction about what foods are good for us and those substances to avoid.
Over time, Church leaders have provided additional instruction on those things that are encouraged or forbidden by the Word of Wisdom, and have taught that substances that are destructive, habit-forming or addictive should be avoided.
Vaping didn’t exist when the Word of Wisdom was received by revelation in 1833 (see Doctrine and Covenants 89), but Church leaders have clarified that vaping is against the Word of Wisdom.
The article “Vaping, Coffee, Tea, and Marijuana” in the August 2019 issue of the New Era magazine states that “Vaping is clearly against the Word of Wisdom.” Church leaders followed up with an official Statement on the Word of Wisdom confirming that vaping and e-cigarettes are prohibited by the Word of Wisdom.
Also see the section “Word of Wisdom and Healthy Practices” in the Church’s General Handbook (section 38.7.14).