I believe the easiest way is to use the compose element. You will need an array containing all the screens, and another array to keep the screens open. Something like that:
screens = [ { id: 1, name: 'Test 1', view: './test-1.html', viewModel: './test-1' }, { id: 2, name: 'Test 2', view: './test-2.html', viewModel: './test-2' } ]; _activeScreens = []; get activeScreens() { return this.screens.filter((s) => this._activeScreens.indexOf(s.id) !== -1); }
In HTML, you just need to use <compose></compose> for each iteration of activeScreens .
I made this example https://gist.run/?id=c32f322b1f56e6f0a83679512247af7b to show you this idea. In my case, I used the html table. In your case, you can use a tab plugin like Bootstrap or jQuery.
Hope this helps!
Fabio luz
source share