Leaving the chord of D major, one finger at a time.
Play the D major with your 1st, 3rd and 2nd fingers.
2nd finger leaves the top-string, to play on the 5th string.
1st finger leaves next
Then the 3rd finger slides down a fret to play the A7, final bar.
The TAB should make things clear:
|.1.&.2.&.3.&.4.&.|.1.&.2.&.3.&.4.&.|
|-------2---------|-------0---------|
|-----3-----------|-----3-----------|
|---2-------------|---2-------------|
|-0---------------|-----------------|
|-----------------|-3---------------|
|-----------------|-----------------|
|.1.&.2.&.3.&.4.&.|.1.&.2.&.3.&.4.&.|
|-------0---------|-------0-----0---|
|-----3-----------|-----2-------2---|
|---0-------------|---0---------0---|
|-----------------|-----------------|
|-2---------------|-0---------------|
|-----------------|-----------------|
And here’s the MIDI file for Leaving Dee.