Donald Trump wore a mask during a visit to a military hospital, the first time the US president has been seen in public with the type of facial covering recommended by health officials as a precaution against spreading coronavirus.