The simplest “dashed line” can also be described as a brush where the opacity is varied along the path of the stroke. Specifically, you could make the dashed line 100% opaque for half the stroke length, and then 0% opaque for the other half.
Pick a brush and open the brush editor. Check the box for “live update” and draw a line on the canvas
Select the “Opacity” setting and modify the input for “Stroke” to look like this:
Set the following Settings: Stroke Threshold: 0.0, Stroke Duration: 2.0, Stroke Hold Time: 0.0
That should be it. Modify the Stroke Duration to make the dashes longer or shorter. Or, adjust the ratio of line-to-gap by moving the Opacity Stroke input to the left or right. This will give you a shorter line and longer gap:
For more fun try leaving opacity alone, but modify brush size, or jitter, or even color with the Stroke input. There’s lots of different ways to make a dashed line.