As a class of food. Though be aware trai is the more common classifier of fruit, ala fruit is trái cây, in the south and quả is the more common classifier, ala fruit is hoa quả, in the north. For example in the south, melon: trái dưa, coconut: trái dừa, pineapple: trái dứa. For example in the north, melon: quả dưa, coconut: quả dừa, pineapple: quả dứa.
Duges66, thank you so much for such a comprehensive answer! I'll take it into account.