Affinity Photo 2 lets you erase areas of a layer using a combination of the Erase Brush Tool, the Brushes panel and the tool's context toolbar. Alternatively, you can use the Background Erase Brush Tool or the Flood Erase Tool to remove pixels from a layer.
You can use the Erase Brush Tool to erase unwanted pixels directly on the layer using the same principles as using the Paint Brush Tool.
The Background Erase Brush Tool takes a sample of the colour under the cursor when you begin to erase, and will remove all closely matching colours along the stroke.
The Flood Erase Tool removes areas of the layer based on the colour selected using a powerful tolerance setting.
As pixels don't exist on a vector layer, a pixel mask is created and applied over the vector layer instead; the erasing process prevents the shape, line or text from being modifiable from that point forward. However, the pixel mask can be modified at any point using pixel brushes. See Layer masks for more details.
You'll notice a mask thumbnail appear next to the layer. While this remains selected you can continue erasing.