Preheat the oven to 350°F (175°C). Line an 8x8-inch baking pan with parchment paper, leaving an overhang on two sides to form a sling. Lightly grease the parchment and any exposed sides of the pan.
In a large bowl, whisk together the flour, rolled oats, brown sugar, granulated sugar, 1 1/2 teaspoons cinnamon, nutmeg (if using), and 1/2 teaspoon salt. Pour in the melted butter and vanilla. Stir until evenly moistened and the mixture is crumbly but holds together when squeezed.
1 1/4 cups all-purpose flour, 1 cup old-fashioned rolled oats, 1/2 cup light brown sugar, 1/4 cup granulated sugar, 1 1/2 teaspoons ground cinnamon, 1/4 teaspoon ground nutmeg, 1/2 teaspoon fine sea salt, 3/4 cup unsalted butter, 1 teaspoon pure vanilla extract
Set aside about 3/4 to 1 cup of the oat mixture for the topping. Press the remaining mixture firmly and evenly into the bottom of the prepared pan to form a sturdy base, using your fingers or the bottom of a measuring cup.
Bake the crust for 10–12 minutes, until it looks set and very lightly golden around the edges. This helps keep the base from getting soggy.
While the crust bakes, peel (optional), core, and finely chop the apples into about 1/4-inch pieces. In a medium bowl, toss the apples with lemon juice, 1/4 cup brown sugar, 1 teaspoon cinnamon, nutmeg or allspice (if using), cornstarch, and a pinch of salt until evenly coated and no dry cornstarch remains. Stir in nuts or dried fruit if using.
3 medium apples, 1 tablespoon fresh lemon juice, 1/4 cup light brown sugar, 1 teaspoon ground cinnamon, 1/8 teaspoon ground nutmeg or allspice, 2 teaspoons cornstarch, salt, 1/4 cup pecans or walnuts, 2 tablespoons raisins or dried cranberries
When the crust comes out of the oven, let it sit for 1–2 minutes, then spread the apple filling evenly over the warm base, all the way into the corners.
Crumble the reserved oat mixture evenly over the apples, leaving some larger and some smaller pieces. Gently pat the crumbs so they adhere slightly without compressing the topping too much.
Return the pan to the oven and bake for 28–34 minutes, until the topping is golden brown and the apple filling is just starting to bubble around the edges.
Place the pan on a wire rack and let the bars cool completely, at least 1–2 hours. For the cleanest slices, chill in the refrigerator for another hour before cutting.
Use the parchment sling to lift the cooled slab from the pan. Cut into 12 larger bars or 16 smaller squares. Serve at room temperature or slightly warmed, with vanilla ice cream or whipped cream if desired.