Possibly. But there might be a risk to it.
For the method I'm thinking of, you need a USB splitter which you can find on Amazon for really cheap.
The idea is to connect this splitter to the Switch
via that dongle that lets you use the Gamecube Controller in handheld mode and then plug the Gamecube Controller adapter into one of the splitters USB ports and then another cable that is USB on both ends into another of the splitters ports. From there, plug the other end of the double USB cable into a portable battery (which you can also find cheap) or whatever it is you're using to charger your switch (as long as it's via USB of course).
BE WARNED THOUGH! There have been reports of 3rd party/unorthodox charging methods such as this bricking Switches. I'm not sure the exact details or even if these reports are outdated or not, but it is something to be aware of.
Personally I would recommend not using this method and just playing Smash and charging the Switch at separate times. But if you want to try both at once, this is a method that MIGHT work, but I have not tried it myself and will not make any guarantee's.