trame is starting to enable support for both vue2 and vue3. This mainly mean that it could be worth building components that are compatible with either version. And to achieve that they are several path possible, but ideally you should rely on the composition API to enable a single bundle for both runtime. Otherwise, you can build “almost the same code” against vue2 and vue3 to produce bundles that can be use for each version of vue independently.
How to specify vue version at runtime
The server instance now has a server.client_type property that you can only be set once to either vue2 or vue3.
In trame<3.0.0 the client_type default is 'vue2' but it is good to start fixing your version in your code as after trame>=3.0.0 the default will be vue3 even if vue2 will still be supported. Also trame>=3 will only keep trame-client and trame-server as dependencies which means it will be the responsibility of the application to list their other trame dependencies such as trame-vtk, trame-vuetify and so on…
If you have different physical JS bundle for each vue version you should have those bundles separated like .../module/vue2.py and .../module/vue3.py which can then internally serve different directories and define their own vue_use. And then you should setup a .../module/__init__.py like below to switch at runtime.