In conventional parlance, vanity is the excessive belief in one‘s own abilities or attractiveness to others. Prior to the 14th century it did not have such narcissistic undertones, and merely meant futility. The related term vainglory is now often seen as an archaic synonym for vanity, but originally meant boasting in vain, i.e. unjustified boasting; although glory is now seen as having an exclusively positive meaning, the Latin term gloria (from which it derives) roughly means boasting, and was often used as a negative criticism.
Thanks for watching.