Blame view

src/views/demo/feat/tab-params/index.vue 495 Bytes
vben authored
1
<template>
vben authored
2
3
  <div class="p-4">
    Current Param : {{ params }}
4
5
6
    <br />
    Keep Alive
    <input />
vben authored
7
  </div>
vben authored
8
9
10
11
12
</template>
<script lang="ts">
  import { computed, defineComponent, unref } from 'vue';
  import { useRouter } from 'vue-router';
  export default defineComponent({
vben authored
13
    name: 'TestTab',
vben authored
14
15
16
17
18
19
20
21
22
23
    setup() {
      const { currentRoute } = useRouter();
      return {
        params: computed(() => {
          return unref(currentRoute).params;
        }),
      };
    },
  });
</script>