playground.vue 643 B

1234567891011121314151617181920212223242526
  1. <template>
  2. <div>
  3. <component :is="currentPlayground" />
  4. </div>
  5. </template>
  6. <script lang="ts">
  7. import Vue from 'vue'
  8. const playgroundComponents = {
  9. 'math/function': () => import('~/components/playground/nn/Simulation.vue'),
  10. 'math/gradient-descent': () => import('~/components/playground/gradient-descent/Index.vue'),
  11. 'tf/minist': () => import('~/components/playground/tf/Index.vue')
  12. } as { [key: string]: Object }
  13. export default Vue.extend({
  14. data() {
  15. return {
  16. currentPlayground:
  17. playgroundComponents[`${this.$route.params.chapter}/${this.$route.params.level}`]
  18. }
  19. }
  20. })
  21. </script>
  22. <style scoped></style>