Preheat the oven to 350°F (175°C).
In a mixing bowl, combine the drained crushed pineapple and sugar.
Stir in the shredded coconut and vanilla extract.
In a separate bowl, mix the crushed Ritz crackers with melted butter.
Add chopped pecans if using, and stir until well combined.
Spread the pineapple mixture evenly in a greased baking dish.
Sprinkle the cracker mixture evenly over the pineapple layer.
Bake in the preheated oven for 30 minutes or until golden brown.
Remove from the oven and let cool for 10 minutes before serving.
Garnish with fresh mint leaves if desired.