There are different ways to do it. You could have the weapon choose(1,2,3), if 1 is chosen then it is a +strength item, if it is a +strength item then you pick a random value for the strength variable of the weapon i.e. strength=random(1,5), then if 3 is chosen its strength is 3, hence a +3 strength item. Then when the player equips this weapon, wherever the equip logic is, you add weapon.strength to player.strength so it'll be player.strength+3. You could actually put logic in to cover all values for all weapons at this point, since dex and vit will be +0.
So on any equip weapon:
player.str = player.str+weapon.str = player.str+3
player.vit = player.vit+weapon.vit = player.vit+0
player.dex = player.dex+weapon.dex = player.dex+0
You can advance this further later on by choosing multiple initial numbers and assigning negative values so you can gain strength and lose vitality on weapon equip.